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

Commit

Permalink
New Release v1.4.0 for OCI Service Broker
Browse files Browse the repository at this point in the history
- Adding support for Osaka (KIX), Melbourne (MEL), Amsterdam (AMS), Jeddah (JED), Montreal (YUL) regions
- Adding support to update admin password in ATP and ADW Services
- Adding support to create and associate streams with streampool Ocid
- Minor Documentation Fixes

Co-authored-by: Ashokkumar Kannan [email protected]
Co-authored-by: Jayasheelan Kumar [email protected]
  • Loading branch information
jayasheelankumar committed Mar 5, 2020
1 parent 0dea7f5 commit 3afa60e
Show file tree
Hide file tree
Showing 19 changed files with 72 additions and 25 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

[1.4.0]

- Adding support for Osaka (KIX), Melbourne (MEL), Amsterdam (AMS), Jeddah (JED), Montreal (YUL) regions
- Adding support to update admin password in ATP and ADW Services
- Adding support to create and associate streams with streampool Ocid
- Minor Bug Fixes

[1.3.3]

- Minor documentation fixes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ See the [Documentation](charts/oci-service-broker/README.md#oci-service-broker)
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.

```
https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz
https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz
```

## Samples
Expand Down
2 changes: 1 addition & 1 deletion charts/oci-service-broker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
apiVersion: v1
description: A Helm chart for installing OCI Service Broker into a Kubernetes cluster
name: oci-service-broker
version: 1.3.3
version: 1.4.0
2 changes: 1 addition & 1 deletion charts/oci-service-broker/docs/adw.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ To provision, an ADW service user needs to provide the following details:
| `compartmentId` | The OCI compartment where the ADW instance will be provisioned. | string | yes |
| `cpuCount` | Number of CPU cores to have. | int | yes |
| `storageSizeTBs` | Size of the DB Storage in Terrabytes. | int | yes |
| `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. The update of password using OCI Service Broker is not supported. Any changes to password after instance provisioning is ignored. <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 |
| `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 |
| `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 |
| `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 |
| `freeFormTags` | free form tags that are to be used for tagging the ADW instance. | object | no |
Expand Down
2 changes: 1 addition & 1 deletion charts/oci-service-broker/docs/atp.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ To provision, an ATP service user needs to provide the following details:
| `compartmentId` | The OCI compartment where the ATP instance will be provisioned. | string | yes |
| `cpuCount` | Number of CPU cores to have. | int | yes |
| `storageSizeTBs` | Size of the DB Storage in Terrabytes. | int | yes |
| `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. The update of password using OCI Service Broker is not supported. Any changes to password after instance provisioning is ignored. <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 |
| `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 |
| `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 |
| `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 |
| `freeFormTags` | free form tags that are to be used for tagging the ATP instance. | object | no |
Expand Down
12 changes: 6 additions & 6 deletions charts/oci-service-broker/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ brew update && brew install kubernetes-service-catalog-client
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.

```plain
https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz
https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz
```

### OCI credentials
Expand Down Expand Up @@ -114,15 +114,15 @@ For quickly testing out OCI Service Broker, TLS can be disabled and an embedded

Helm 3.x syntax:
```bash
helm install oci-service-broker https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz \
helm install oci-service-broker https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz \
--set ociCredentials.secretName=ocicredentials \
--set storage.etcd.useEmbedded=true \
--set tls.enabled=false
```

Helm 2.x syntax:
```bash
helm install https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz --name oci-service-broker \
helm install https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz --name oci-service-broker \
--set ociCredentials.secretName=ocicredentials \
--set storage.etcd.useEmbedded=true \
--set tls.enabled=false
Expand Down Expand Up @@ -226,15 +226,15 @@ Replace the values of --set arguments with your appropriate values to install th

Helm 3.x syntax:
```bash
helm install oci-service-broker https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz \
helm install oci-service-broker https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz \
--set ociCredentials.secretName=ocicredentials \
--set tls.secretName=certsecret \
--set storage.etcd.servers=<comma separated list of etcd servers>
```

Helm 2.x syntax:
```bash
helm install https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz --name oci-service-broker \
helm install https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz --name oci-service-broker \
--set ociCredentials.secretName=ocicredentials \
--set tls.secretName=certsecret \
--set storage.etcd.servers=<comma separated list of etcd servers>
Expand Down Expand Up @@ -288,7 +288,7 @@ Refer [Restrict access to Service Catalog resources using RBAC](security.md#rest
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.
```bash
curl -LO https://github.com/oracle/oci-service-broker/releases/download/v1.3.3/oci-service-broker-1.3.3.tgz | tar xz
curl -LO https://github.com/oracle/oci-service-broker/releases/download/v1.4.0/oci-service-broker-1.4.0.tgz | tar xz
```
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.
Expand Down
2 changes: 2 additions & 0 deletions charts/oci-service-broker/samples/oci-service-broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ kind: ClusterServiceBroker
metadata:
name: oci-service-broker
spec:
# Make sure to replace <NAMESPACE_OF_OCI_SERVICE_BROKER> with suitable namespace if OCI Service Broker and Service Catalog are installed in different namespaces.
# Please remove <NAMESPACE_OF_OCI_SERVICE_BROKER> from below URL attribute If both OCI Service Broker and Service Catalog are installed in the same namespace.
url: http://oci-service-broker.<NAMESPACE_OF_OCI_SERVICE_BROKER>:8080
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ spec:
name: teststream
compartmentId: CHANGE_COMPARTMENT_OCID_HERE
partitions: CHANGE_PARTITION_COUNT_HERE
# Use streampoolId for creating stream associated with a streampool. Do not use compartmentId when using streampoolId
# streampoolId: CHANGE_STREAM_POOL_OCID_HERE
2 changes: 1 addition & 1 deletion charts/oci-service-broker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ image:
repository: iad.ocir.io/oracle/oci-service-broker

# Tag of the image
tag: 1.3.3
tag: 1.4.0

# The image pull policy
pullPolicy: Always
Expand Down
8 changes: 4 additions & 4 deletions oci-service-broker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ apply plugin: 'maven-publish'
archivesBaseName = 'oci-service-broker'

// Sometimes, the version has to be overridden from command line
version = project.hasProperty('version_num') ? project.getProperty('version_num') : '1.3.3'
version = project.hasProperty('version_num') ? project.getProperty('version_num') : '1.4.0'
ext.dockerGroup = 'iad.ocir.io/oci-cnp-dev'
mainClassName = 'com.oracle.oci.osb.Broker'

sourceCompatibility = 10

ext {
ociSdkVersion = "1.6.3"
ociSdkVersion = "1.13.2"
jerseyVersion = "2.27"
hk2Version = "2.5.0-b42"
hamcrestVersion = "1.3"
jacksonVersion = "2.9.9";
jacksonDatabindVersion = "2.9.9";
jacksonVersion = "2.10.1";
jacksonDatabindVersion = "2.10.1";
javaxwsrsVersion = "2.1.1"
bedrockVersion = "5.0.7"
jetcdVersion = "0.3.0"
Expand Down
4 changes: 2 additions & 2 deletions oci-service-broker/download_SDK_libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
#sdk jars and their dependency jars. The jars are written to libs directory.

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SDK_VERSION="1.6.3"
SDK_VERSION="1.13.2"
TEMP_DIR="/tmp/oci-java-sdk"
rm -rf ${TEMP_DIR}
mkdir -p ${TEMP_DIR}
mkdir -p ${SCRIPT_DIR}/libs
echo "Downloading oci-java-sdk version v${SDK_VERSION} and the dependent libraries..."
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
unzip -qq ${TEMP_DIR}/oci-java-sdk.zip -d ${TEMP_DIR}
cp ${TEMP_DIR}/lib/oci-java-sdk-full-1.6.3.jar ${SCRIPT_DIR}/libs/
cp ${TEMP_DIR}/lib/oci-java-sdk-full-1.13.2.jar ${SCRIPT_DIR}/libs/
cp ${TEMP_DIR}/third-party/lib/*.jar ${SCRIPT_DIR}/libs/
rm -rf ${TEMP_DIR}
echo "oci-java-sdk and the dependent libraries are downloaded to ${SCRIPT_DIR}/libs directory"
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ public ServiceInstanceAsyncOperation updateServiceInstance(String instanceId, Se
Map<String, Object> params = (Map<String, Object>) body.getParameters();

String name = RequestUtil.getStringParameter(params, REQ_PARAM_NAME, false);
String password = RequestUtil.getStringParameter(params, REQ_PARAM_PASSWORD, false);
Integer cpuCount = RequestUtil.getIntegerParameter(params, REQ_PARAM_CPU_COUNT, false);
Integer storageSize = RequestUtil.getIntegerParameter(params, REQ_PARAM_STORAGE_SIZE_TB, false);
Map<String, String> tags = RequestUtil.getMapStringParameter(params, REQ_PARAM_TAGS, false);
Expand All @@ -317,7 +318,7 @@ public ServiceInstanceAsyncOperation updateServiceInstance(String instanceId, Se
.DEFINED_TAGS, false);

try (AutonomousDatabaseOCIClient adbServiceClient = new AutonomousDatabaseOCIClient(provider, compartmentId)) {
adbServiceClient.update(svcData.getOcid(), name, cpuCount, storageSize, tags, definedTags, licenseModelStr, autoScalingEnabled);
adbServiceClient.update(svcData.getOcid(), name, password, cpuCount, storageSize, tags, definedTags, licenseModelStr, autoScalingEnabled);
response.setStatusCode(HTTP_ACCEPTED);
} catch(UpdateNotRequiredException ue) {
response.setStatusCode(HTTP_OK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public AutonomousDatabaseInstance create(String displayName, String dbName, Crea
* @param autoScalingEnabled flag to enable autoscaling
* @return AutonomousDatabase
*/
public AutonomousDatabaseInstance update(String adOCID, String displayName, int cpuCount, int StorageSize,
public AutonomousDatabaseInstance update(String adOCID, String displayName, String password, int cpuCount, int StorageSize,
Map<String, String> tags, Map<String, Map<String, Object>> definedTags,
String licenseModelStr, boolean autoScalingEnabled) {
AutonomousDatabase ad = getADInstance(adOCID);
Expand All @@ -109,6 +109,11 @@ public AutonomousDatabaseInstance update(String adOCID, String displayName, int
debugLog(LOGGER, "DisplayName to be updated.from:%s;to:%s", Level.FINE, ad.getDisplayName(), displayName);
updateRequired = true;
}
if (!Utils.isNullOrEmptyString(password)) {
reqBuilder = reqBuilder.adminPassword(password);
debugLog(LOGGER, "Admin password to be updated.", Level.FINE);
updateRequired = true;
}
if (cpuCount > 0 && ad.getCpuCoreCount() != cpuCount) {
reqBuilder = reqBuilder.cpuCoreCount(cpuCount);
debugLog(LOGGER, "CpuCoreCount to be updated.from:%s;to:%s", Level.FINE, ad.getCpuCoreCount()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.oracle.oci.osb.adapter.ServiceAdapter;
import com.oracle.oci.osb.model.*;
import com.oracle.oci.osb.model.Error;
import com.oracle.oci.osb.ociclient.SystemPropsAuthProvider;
import com.oracle.oci.osb.store.BindingData;
import com.oracle.oci.osb.store.ServiceData;
Expand All @@ -31,13 +32,18 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.logging.Logger;

import static com.oracle.oci.osb.util.Utils.getLogger;

/**
* OSSServiceAdapter provides implementation to provision and manage
* Oracle Streaming Service instances.
*/
public class OSSServiceAdapter implements ServiceAdapter {

private static final Logger LOGGER = getLogger(OSSServiceAdapter.class);

public static final String PARTITIONS = "partitions";
private static final String STREAM_ID = "streamId";
private static final String MESSAGE_ENDPOINT = "messageEndpoint";
Expand All @@ -49,8 +55,8 @@ public class OSSServiceAdapter implements ServiceAdapter {

public OSSServiceAdapter() {
super();
streamAdminClient = new StreamAdminClient(new SystemPropsAuthProvider().getAuthProvider());
streamAdminClient.setEndpoint("https://streams." + System.getProperty(Constants.REGION_ID) + ".streaming.oci.oraclecloud.com");
streamAdminClient = StreamAdminClient.builder().build(new SystemPropsAuthProvider().getAuthProvider());
streamAdminClient.setRegion(System.getProperty(Constants.REGION_ID));
}

@Override
Expand Down Expand Up @@ -172,14 +178,25 @@ public ServiceInstanceProvision provisionServiceInstance(String instanceId, Serv
Map mapParameters = validateParamsExists(body.getParameters());

String streamName = RequestUtil.getNonEmptyStringParameter(mapParameters, Constants.NAME);
String compartmentId = RequestUtil.getNonEmptyStringParameter(mapParameters, Constants.COMPARTMENT_ID);
Integer partitions = RequestUtil.getIntegerParameter(mapParameters, PARTITIONS, true);
String streampoolId = RequestUtil.getStringParameter(mapParameters, Constants.STREAM_POOL_ID, false);;
String compartmentId = RequestUtil.getStringParameter(mapParameters, Constants.COMPARTMENT_ID, false);
Map<String, Map<String, Object>> definedTags = RequestUtil.getMapMapObjectParameter(mapParameters,
Constants.DEFINED_TAGS, false);

if(streampoolId == null && compartmentId == null) {
LOGGER.info("Both CompartmentId and StreamPoolId cannot be null");
throw Errors.missingParameters();
}

CreateStreamDetails.Builder createStreamBuilder = CreateStreamDetails.builder().name(streamName)
.compartmentId(compartmentId).partitions(partitions).definedTags(definedTags).freeformTags
(freeFormTags);
.partitions(partitions).definedTags(definedTags).freeformTags(freeFormTags);

if(streampoolId != null) {
createStreamBuilder.streamPoolId(streampoolId);
} else {
createStreamBuilder.compartmentId(compartmentId);
}

CreateStreamResponse createResponse = streamAdminClient.createStream(CreateStreamRequest.builder()
.createStreamDetails(createStreamBuilder.build()).build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ private static Identity parseIdentity(String identityHeader) {
}
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@ public class Constants {
public static final String PROVISIONING = "provisioning";
public static final String OCID = "ocid";
public static final String AUTOSCALING_ENABLED = "autoScaling";
public static final String STREAM_POOL_ID = "streampoolId";
}
4 changes: 4 additions & 0 deletions oci-service-broker/src/main/resources/adw-catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@
"description": "Display Name or the ADW instance",
"type": "string"
},
"password": {
"description": "Password for Admin User",
"type": "string"
},
"cpuCount": {
"description": "CPU Count",
"type": "integer"
Expand Down
4 changes: 4 additions & 0 deletions oci-service-broker/src/main/resources/atp-catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@
"description": "Display Name or the ATP instance",
"type": "string"
},
"password": {
"description": "Password for Admin User",
"type": "string"
},
"cpuCount": {
"description": "CPU Count",
"type": "integer"
Expand Down
4 changes: 4 additions & 0 deletions oci-service-broker/src/main/resources/oss-catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
"description": "The number of partition in the stream",
"type": "integer"
},
"streampoolId": {
"description": "The OCID of the stream pool that contains the stream",
"type": "string"
},
"freeFormTags": {
"description": "Free form tags",
"type": "object",
Expand Down

0 comments on commit 3afa60e

Please sign in to comment.