Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Commit 46ff7c9

Browse files
New Release v1.3.0 for OCI Service Broker
- Adding support for Mumbai (BOM), Zurich (ZRH), Sao Paulo (GRU), Sydney (SYD) regions - Adding support to update license type in ATP and ADW Service - Adding support for autoscaling in ATP and ADW Service Co-authored-by: Ashokkumar Kannan ashokkumar.kannan@oracle.com Co-authored-by: Jayasheelan Kumar jayasheelan.kumar@oracle.com Co-authored-by: Naman Mehta naman.mehta@oracle.com
1 parent 523aeb3 commit 46ff7c9

20 files changed

+134
-20
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
[1.3.0]
9+
10+
- Adding support for Mumbai (BOM), Zurich (ZRH), Sao Paulo (GRU), Sydney (SYD) regions
11+
- Adding support to update license type in ATP and ADW Service
12+
- Adding support for autoscaling in ATP and ADW Service
13+
814
[1.2.1]
915

1016
- Minor Update to use unified API for ATP/ADW service. Internal change with no customer impact

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ See the [Documentation](charts/oci-service-broker/README.md#oci-service-broker)
2929
The OCI Service Broker is packaged as Helm chart for making it easy to install in Kubernetes Clusters. The chart can be downloaded from below URL.
3030

3131
```
32-
https://github.com/oracle/oci-service-broker/releases/download/v1.2.1/oci-service-broker-1.2.1.tgz
32+
https://github.com/oracle/oci-service-broker/releases/download/v1.3.0/oci-service-broker-1.3.0.tgz
3333
```
3434

3535
## Samples

charts/oci-service-broker/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
apiVersion: v1
66
description: A Helm chart for installing OCI Service Broker into a Kubernetes cluster
77
name: oci-service-broker
8-
version: 1.2.1
8+
version: 1.3.0

charts/oci-service-broker/docs/adw.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ To provision, an ADW service user needs to provide the following details:
6060
| `storageSizeTBs` | Size of the DB Storage in Terrabytes. | int | yes |
6161
| `password` | ADW Service will pre-provision a DB Admin user when it provisions an ADW instance. The user needs to provide a password to be set for this Admin user.<br>The OCI ADW service requires the password to satisfy the below rules.<br><ul><li>The length should be 12 to 18 characters.</li><li>A password must include an upper case, lower case, and special character.</li></ul> | string | yes |
6262
| `licenseType` | Use your existing database software licenses(BYOL) or Subscribe to new database software licenses and the Database Cloud Service.<br>Valid values are:<ul><li>BYOL</li><li>NEW</li></ul>. | string | yes |
63+
| `autoScaling` | The flag to enable auto-scaling in ADW Instance. Allows system to use up to three times the provisioned number of cores as the workload increases. By default, this flag is set to false. | boolean| no |
6364
| `freeFormTags` | free form tags that are to be used for tagging the ADW instance. | object | no |
6465
| `definedTags` | The defined tags that are to be used for tagging the ADW instance. | object | no |
6566

charts/oci-service-broker/docs/atp.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ To provision, an ATP service user needs to provide the following details:
6060
| `storageSizeTBs` | Size of the DB Storage in Terrabytes. | int | yes |
6161
| `password` | ATP Service will pre-provision a DB Admin user when it provisions an ATP instance. The user needs to provide a password to be set for this Admin user.<br>The OCI ATP service requires the password to satisfy the below rules.<br><ul><li>The length should be 12 to 18 characters.</li><li>A password must include an upper case, lower case, and special character.</li></ul> | string | yes |
6262
| `licenseType` | Use your existing database software licenses(BYOL) or Subscribe to new database software licenses and the Database Cloud Service.<br>Valid values are:<ul><li>BYOL</li><li>NEW</li></ul>. | string | yes |
63+
| `autoScaling` | The flag to enable auto-scaling in ATP Instance. Allows system to use up to three times the provisioned number of cores as the workload increases. By default, this flag is set to false. | boolean| no |
6364
| `freeFormTags` | free form tags that are to be used for tagging the ATP instance. | object | no |
6465
| `definedTags` | The defined tags that are to be used for tagging the ATP instance. | object | no |
6566

charts/oci-service-broker/docs/installation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ brew update && brew install kubernetes-service-catalog-client
6969
The OCI Service Broker is packaged as Helm chart for making it easy to install in Kubernetes. The chart is available at [charts/oci-service-broker](../) directory.
7070

7171
```plain
72-
https://github.com/oracle/oci-service-broker/releases/download/v1.2.1/oci-service-broker-1.2.1.tgz
72+
https://github.com/oracle/oci-service-broker/releases/download/v1.3.0/oci-service-broker-1.3.0.tgz
7373
```
7474

7575
### OCI credentials
@@ -107,7 +107,7 @@ The value for `ociCredentials.secretName` should contain the name of the Kuberne
107107
For quickly testing out OCI Service Broker, TLS can be disabled and an embedded etcd container can be used. This can be used for quickly setting up the Broker but not recommended in PRODUCTION environments. Please refer to [Recommended Setup](#recommended-setup) for PRODUCTION environments
108108

109109
```bash
110-
helm install https://github.com/oracle/oci-service-broker/releases/download/v1.2.1/oci-service-broker-1.2.1.tgz --name oci-service-broker \
110+
helm install https://github.com/oracle/oci-service-broker/releases/download/v1.3.0/oci-service-broker-1.3.0.tgz --name oci-service-broker \
111111
--set ociCredentials.secretName=ocicredentials \
112112
--set storage.etcd.useEmbedded=true \
113113
--set tls.enabled=false
@@ -200,7 +200,7 @@ Please note that the names in keys i.e. keyStore.password and keyStore must not
200200

201201
Replace the values of --set arguments with your appropriate values to install the OCI Service Broker. User needs to point docker images either from OCIR or from their repository.
202202
```bash
203-
helm install https://github.com/oracle/oci-service-broker/releases/download/v1.2.1/oci-service-broker-1.2.1.tgz --name oci-service-broker \
203+
helm install https://github.com/oracle/oci-service-broker/releases/download/v1.3.0/oci-service-broker-1.3.0.tgz --name oci-service-broker \
204204
--set ociCredentials.secretName=ocicredentials \
205205
--set tls.secretName=certsecret \
206206
--set storage.etcd.servers=<comma separated list of etcd servers>
@@ -245,7 +245,7 @@ Refer [Restrict access to Service Catalog resources using RBAC](security.md#rest
245245
Sample files for various services are available under [`oci-service-broker/samples`](../samples) directory inside the charts. The below command extracts chart that contains the sample files.
246246

247247
```bash
248-
curl https://github.com/oracle/oci-service-broker/releases/download/v1.2.1/oci-service-broker-1.2.1.tgz | tar xz
248+
curl https://github.com/oracle/oci-service-broker/releases/download/v1.3.0/oci-service-broker-1.3.0.tgz | tar xz
249249
```
250250

251251
Create a `ClusterServiceBroker` resource with OCI Service Broker URL to register the broker. Use the below register yaml file after updating the namespace of the OCI Service Broker.

charts/oci-service-broker/samples/adw/adw-instance-plain.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ spec:
1717
storageSizeTBs: 1
1818
password: s123456789S@
1919
licenseType: NEW
20+
autoScaling: false
2021
freeFormTags:
2122
testtag: demo
2223
# definedTags:

charts/oci-service-broker/samples/adw/adw-instance.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ spec:
1616
cpuCount: 1
1717
storageSizeTBs: 1
1818
licenseType: new
19+
autoScaling: false
1920
freeFormTags:
2021
testtag: demo
2122
# definedTags:

charts/oci-service-broker/samples/atp/atp-instance-plain.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ spec:
1717
storageSizeTBs: 1
1818
password: s123456789S@
1919
licenseType: NEW
20+
autoScaling: false
2021
freeFormTags:
2122
testtag: demo
2223
# definedTags:

charts/oci-service-broker/samples/atp/atp-instance.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ spec:
1616
cpuCount: 1
1717
storageSizeTBs: 1
1818
licenseType: NEW
19+
autoScaling: false
1920
freeFormTags:
2021
testtag: demo
2122
# definedTags:

charts/oci-service-broker/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ image:
1414
repository: iad.ocir.io/oracle/oci-service-broker
1515

1616
# Tag of the image
17-
tag: 1.2.1
17+
tag: 1.3.0
1818

1919
# The image pull policy
2020
pullPolicy: Always

oci-service-broker/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ apply plugin: 'maven-publish'
3030
archivesBaseName = 'oci-service-broker'
3131

3232
// Sometimes, the version has to be overridden from command line
33-
version = project.hasProperty('version_num') ? project.getProperty('version_num') : '1.2.1'
33+
version = project.hasProperty('version_num') ? project.getProperty('version_num') : '1.3.0'
3434
ext.dockerGroup = 'iad.ocir.io/oci-cnp-dev'
3535
mainClassName = 'com.oracle.oci.osb.Broker'
3636

3737
sourceCompatibility = 10
3838

3939
ext {
40-
ociSdkVersion = "1.5.6"
40+
ociSdkVersion = "1.6.3"
4141
jerseyVersion = "2.27"
4242
hk2Version = "2.5.0-b42"
4343
hamcrestVersion = "1.3"
44-
jacksonVersion = "2.9.8";
45-
jacksonDatabindVersion = "2.9.8";
44+
jacksonVersion = "2.9.9";
45+
jacksonDatabindVersion = "2.9.9";
4646
javaxwsrsVersion = "2.1.1"
4747
bedrockVersion = "5.0.7"
4848
jetcdVersion = "0.3.0"
49-
guvaVersion = "27.0.1-android"
49+
guvaVersion = "27.1-jre"
5050
srcBuildRepo = project.hasProperty('src_build_repo') ? project.getProperty('src_build_repo') : "${projectDir}/src-build-repo/"
5151
unbundleOciSdk = project.hasProperty('unbundle_oci_java_sdk') ? project.getProperty('unbundle_oci_java_sdk').toBoolean() : false
5252
depLibJarPath = "build/lib"

oci-service-broker/download_SDK_libs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
#sdk jars and their dependency jars. The jars are written to libs directory.
1010

1111
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
12-
SDK_VERSION="1.5.6"
12+
SDK_VERSION="1.6.3"
1313
TEMP_DIR="/tmp/oci-java-sdk"
1414
rm -rf ${TEMP_DIR}
1515
mkdir -p ${TEMP_DIR}
1616
mkdir -p ${SCRIPT_DIR}/libs
1717
echo "Downloading oci-java-sdk version v${SDK_VERSION} and the dependent libraries..."
1818
curl -sSL https://github.com/oracle/oci-java-sdk/releases/download/v${SDK_VERSION}/oci-java-sdk.zip -o ${TEMP_DIR}/oci-java-sdk.zip
1919
unzip -qq ${TEMP_DIR}/oci-java-sdk.zip -d ${TEMP_DIR}
20-
cp ${TEMP_DIR}/lib/oci-java-sdk-full-1.5.6.jar ${SCRIPT_DIR}/libs/
20+
cp ${TEMP_DIR}/lib/oci-java-sdk-full-1.6.3.jar ${SCRIPT_DIR}/libs/
2121
cp ${TEMP_DIR}/third-party/lib/*.jar ${SCRIPT_DIR}/libs/
2222
rm -rf ${TEMP_DIR}
2323
echo "oci-java-sdk and the dependent libraries are downloaded to ${SCRIPT_DIR}/libs directory"

oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/adb/AutonomousDatabaseAdapter.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ public ServiceInstanceProvision provisionServiceInstance(String instanceId, Serv
229229
Integer storageSize = RequestUtil.getIntegerParameter(reqParams, REQ_PARAM_STORAGE_SIZE_TB, true);
230230
String password = RequestUtil.getNonEmptyStringParameter(reqParams, REQ_PARAM_PASSWORD);
231231
String licenseModelStr = RequestUtil.getNonEmptyStringParameter(reqParams, REQ_PARAM_LICENSE_MODEL);
232+
boolean autoScalingEnabled = RequestUtil.getBooleanParameterDefaultValueFalse(reqParams,
233+
Constants.AUTOSCALING_ENABLED, false);
232234
Map<String, Map<String, Object>> definedTags = RequestUtil.getMapMapObjectParameter(reqParams, Constants
233235
.DEFINED_TAGS, false);
234236
if (!(LicenseModel.NEW.toString().equalsIgnoreCase(licenseModelStr) || LicenseModel.BYOL.toString()
@@ -248,7 +250,8 @@ public ServiceInstanceProvision provisionServiceInstance(String instanceId, Serv
248250
adbSvcData.putMetadata(Constants.DB_WORKLOAD_TYPE, getInstanceTypeString().toUpperCase());
249251

250252
AutonomousDatabaseInstance autonomousDatabaseInstance = adbServiceClient.create(name, dbName,
251-
getDBWorkload(getInstanceTypeString()), cpuCount, storageSize, freeFormTags, definedTags, password, isLicenseIncluded);
253+
getDBWorkload(getInstanceTypeString()), cpuCount, storageSize, freeFormTags, definedTags, password,
254+
isLicenseIncluded, autoScalingEnabled);
252255

253256
adbSvcData.setOcid(autonomousDatabaseInstance.getId());
254257
response.setStatusCode(HTTP_ACCEPTED);
@@ -297,6 +300,15 @@ public ServiceInstanceAsyncOperation updateServiceInstance(String instanceId, Se
297300
Integer cpuCount = RequestUtil.getIntegerParameter(params, REQ_PARAM_CPU_COUNT, false);
298301
Integer storageSize = RequestUtil.getIntegerParameter(params, REQ_PARAM_STORAGE_SIZE_TB, false);
299302
Map<String, String> tags = RequestUtil.getMapStringParameter(params, REQ_PARAM_TAGS, false);
303+
String licenseModelStr = RequestUtil.getNonEmptyStringParameter(params, REQ_PARAM_LICENSE_MODEL);
304+
boolean autoScalingEnabled = RequestUtil.getBooleanParameterDefaultValueFalse(params, Constants.AUTOSCALING_ENABLED, false);
305+
306+
if (licenseModelStr != null && (!(LicenseModel.NEW.toString().equalsIgnoreCase(licenseModelStr) || LicenseModel.BYOL.toString()
307+
.equalsIgnoreCase(licenseModelStr)))) {
308+
LOGGER.severe("Invalid License Model : " + licenseModelStr);
309+
throw Errors.invalidParameter(REQ_PARAM_LICENSE_MODEL);
310+
}
311+
300312
if(!tags.isEmpty()) {
301313
tags.put(Constants.OSB_INSTANCE_ID_LABEL, instanceId);
302314
}
@@ -305,7 +317,7 @@ public ServiceInstanceAsyncOperation updateServiceInstance(String instanceId, Se
305317
.DEFINED_TAGS, false);
306318

307319
try (AutonomousDatabaseOCIClient adbServiceClient = new AutonomousDatabaseOCIClient(provider, compartmentId)) {
308-
adbServiceClient.update(svcData.getOcid(), name, cpuCount, storageSize, tags, definedTags);
320+
adbServiceClient.update(svcData.getOcid(), name, cpuCount, storageSize, tags, definedTags, licenseModelStr, autoScalingEnabled);
309321
response.setStatusCode(HTTP_ACCEPTED);
310322
} catch(UpdateNotRequiredException ue) {
311323
response.setStatusCode(HTTP_OK);
@@ -532,9 +544,11 @@ private boolean isSameInstance(AutonomousDatabaseInstance instance, Map<String,
532544
Integer cpuCount = RequestUtil.getIntegerParameter(reqParams, REQ_PARAM_CPU_COUNT, false);
533545
Integer storageSize = RequestUtil.getIntegerParameter(reqParams, REQ_PARAM_STORAGE_SIZE_TB, false);
534546
String licenseModel = RequestUtil.getStringParameter(reqParams, REQ_PARAM_LICENSE_MODEL, false);
547+
boolean isAutoScalingEnabled = RequestUtil.getBooleanParameterDefaultValueFalse(reqParams,
548+
Constants.AUTOSCALING_ENABLED, false);
535549
if (instance.getDisplayName().equals(displayName) && instance.getCpuCoreCount() == cpuCount &&
536550
instance.getStorageSizeInGBs() == storageSize && instance.getDbName().equals(dbName) && instance
537-
.getLicenseModel().toString().equalsIgnoreCase(licenseModel)) {
551+
.getLicenseModel().toString().equalsIgnoreCase(licenseModel) && instance.isAutoScalingEnabled() == isAutoScalingEnabled) {
538552
return true;
539553
}
540554
return false;

oci-service-broker/src/main/java/com/oracle/oci/osb/adapters/adb/AutonomousDatabaseInstance.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public class AutonomousDatabaseInstance {
1818
private int storageSizeInGBs;
1919
private String dbName;
2020
private AutonomousDatabaseAdapter.LicenseModel licenseModel;
21+
private boolean autoScalingEnabled;
2122
private Map<String, String> freeformTags;
2223
private LifecycleState lifecycleState;
2324

@@ -31,7 +32,8 @@ public enum TYPE {
3132

3233

3334
public AutonomousDatabaseInstance(String id, AutonomousDatabaseAdapter.DBWorkloadType dbWorkloadType, String displayName, int cpuCoreCount, int
34-
storageSizeInGBs, String dbName, AutonomousDatabaseAdapter.LicenseModel licenseModel, Map<String, String> freeformTags, LifecycleState lifecycleState) {
35+
storageSizeInGBs, String dbName, AutonomousDatabaseAdapter.LicenseModel licenseModel, boolean autoScalingEnabled,
36+
Map<String, String> freeformTags, LifecycleState lifecycleState) {
3537
this.id = id;
3638
this.dbWorkloadType = dbWorkloadType;
3739
this.displayName = displayName;
@@ -41,6 +43,7 @@ public AutonomousDatabaseInstance(String id, AutonomousDatabaseAdapter.DBWorkloa
4143
this.licenseModel = licenseModel;
4244
this.freeformTags = freeformTags;
4345
this.lifecycleState = lifecycleState;
46+
this.autoScalingEnabled = autoScalingEnabled;
4447
}
4548

4649
public static LifecycleState lifecycleState(String lifecycleStateStr) {
@@ -76,6 +79,8 @@ public int getStorageSizeInGBs() {
7679
return storageSizeInGBs;
7780
}
7881

82+
public boolean isAutoScalingEnabled() { return autoScalingEnabled; }
83+
7984
public LifecycleState getLifecycleState() {
8085
return lifecycleState;
8186
}

0 commit comments

Comments
 (0)