cloudsoft.io

Getting Started

With the Cloudsoft Service Broker for Cloud Foundry

Prerequisites

  • Before proceeding you must have have accepted the Cloudsoft Trial Software License Agreement. If you have not yet done so, please visit http://www.cloudsoft.io/getcsb.
  • A running Cloud Foundry instance
  • To install and configure the brokers, you will require admin access to your CF instance
    • This is a limitation of Cloud Foundry

There are three steps to complete to get you up-and-running with the Cloudsoft Service Broker (CSB). These are:

  1. Install AMP
  2. Install the Brooklyn Service Broker
  3. Install the Cloudsoft Service Broker

If you have any questions, please join us on Slack.

Notes on the examples

In the example commands below, the CF URL is bosh-lite.com with credentials of admin:admin - please substitute as appropriate with the details that are specific to your Cloud Foundry instance.

1. Install AMP

The first step is to install Cloudsoft Application Management Platform (AMP).

If you do not have an AMP running already, please read this guidance on how to install your own AMP server.

Add blueprints to your AMP catalog

Once you have a running AMP server, you need to add some blueprints to your AMP server. To do this:

  • Go to the Blueprint Composer
  • Select the YAML Editor view
  • Download the YAML file and paste it into the editor
  • Click Add to catalog

This will add a range of sample blueprints to your AMP catalog that are suitable for being deployed from your Cloud Foundry as services.

2. Install BSB

The next step is to install the Brooklyn Service Broker (BSB) in your Cloud Foundry (as a broker) and configure it to point to your AMP installation.

Installing the BSB Cloud Foundry broker makes the blueprints, that were added to the catalog (above), available as Cloud Foundry services.

  • First download the BSB from Github
  • Now create a yaml file, called manifest.yml - it must be in the same directory as the .war file you downloaded. The content is shown below.
applications:
- name: Brooklyn-Service-Broker
  env:
    BROOKLYN_URI: https://<<YOUR AMP URL>>:8081
    BROOKLYN_USERNAME: admin
    BROOKLYN_PASSWORD: password
    SECURITY_USER_NAME: test-user
    SECURITY_USER_PASSWORD: test-user-password
    BROOKLYN_NAMESPACE: br
    BROOKLYN_LOCATION: amazon-eu-west-1

Download the YAML file

Guidance on modifying the yaml:

  • BROOKLYN_URI: should be the URL to your AMP server (assuming you are running it on port 8081)
  • BROOKLYN_USERNAME & BROOKLYN_PASSWORD: the credentials you use to log in to your AMP server
  • BROOKLYN_LOCATION: should be the name of an already defined location in your AMP instance (e.g. amazon-eu-west-1). This location is where services will be deployed to when a CF developer creates a service from the listing in the CF Marketplace.
  • SECURITY_USER_NAME & SECURITY_USER_PASSWORD: these are new credentials you are creating that will use to access the broker in CF

You are now ready to access your CF instance (skipping SSL validation if you are using a non-production CF instance):

cf api --skip-ssl-validation https://api.bosh-lite.com
cf login

Now create an Organization and Space. For example:

cf create-org cloudsoft
cf target -o cloudsoft
cf create-space dev
cf target -s dev

You are now ready to push the .war file to your Cloud Foundry instance:

cf push -p path/to/brooklyn-service-broker.war -b https://github.com/cloudfoundry/java-buildpack.git

The output should be similar to:

Using manifest file /workspace/bsb-install/manifest.yml

Creating app Brooklyn-Service-Broker in org cloudsoft / space dev as admin...
OK

...

Showing health and status for app Brooklyn-Service-Broker in org cloudsoft / space dev as admin...
OK

requested state: started
instances: 1/1
usage: 256M x 1 instances
urls: brooklyn-service-broker.bosh-lite.com
last uploaded: Tue Sep 20 15:14:00 UTC 2016
stack: cflinuxfs2
buildpack: https://github.com/cloudfoundry/java-buildpack.git

     state     since                    cpu    memory           disk      details
#0   running   2016-09-20 04:15:08 PM   0.0%   247.2M of 256M   0 of 1G

As you can see, the BSB has been successfully started.

If you subsequently need to point the BSB at a different AMP, cycle login credentials or wish to change the location where services are deployed to, you can update the environment variables and restage the broker.

For example, to point to a different AMP use the following cf commands:

cf set-env Brooklyn-Service-Broker BROOKLYN_URI <new uri>
cf restage Brooklyn-Service-Broker

The next step is to register the broker and services in Cloud Foundry.

Registering the Broker and Services

To register, use the following command:

cf create-service-broker Brooklyn-Service-Broker test-user test-user-password http://brooklyn-service-broker.bosh-lite.com

In the above command:

  • ‘Brooklyn-Service-Broker’ is the name dictionary value from manifest.yml you configured in the Install BSB step
  • ‘test-user’ is the SECURITY_USER_NAME value
  • ‘test-user-password’ is the SECURITY_USER_PASSWORD value
  • the URL (http://brooklyn-service-broker.bosh-lite.com) is the name as a prefix on your CF URL (i.e. bosh-lite.com)

The command should complete successfully:

Creating service broker Brooklyn-Service-Broker as admin...
OK

The next step is to install the CSB in Cloud Foundry.

3. Install CSB

To install the Cloudsoft Service Broker (CSB) in Cloud Foundry:

  • First download the CSB as a .war file
  • Now create a yaml file, called manifest.yml - it must be in the same directory as the .war file you downloaded. The content is shown below.
applications:
- name: Cloudsoft Service Broker
  memory: 1G
  env:
    BROOKLYN_BROKER_APP_NAME: amp-service-broker
    CF_URL: api.bosh-lite.com
    CF_USERNAME: admin
    CF_PASSWORD: admin
    CF_ORG: cloudsoft
    CF_SPACE: dev
    SECURITY_USER_NAME: test-user
    SECURITY_USER_PASSWORD: test-user-password

Download the YAML file

Guidance on modifying the yaml - the following values should match those you defined in the Install BSB step:

  • CF_ORG & CF_SPACE: these should match the Organization and Space
  • SECURITY_USER_NAME & SECURITY_USER_PASSWORD: these should match the credentials

You are now ready to push the .war file to your Cloud Foundry instance:

cf push -p path/to/cloudsoft-service-broker-1.0.0.war

The output should be similar to:

Using manifest file /workspace/csb-install/manifest.yml

Creating app Cloudsoft Service Broker in org cloudsoft / space dev as admin...
OK

...

0 of 1 instances running, 1 starting
1 of 1 instances running

App started

OK

App Cloudsoft Service Broker was started using this command `CALCULATED_MEMORY=$($PWD/.java-buildpack/open_jdk_jre/bin/java-buildpack-memory-calculator-2.0.2_RELEASE -memorySizes=metaspace:64m..,stack:228k.. -memoryWeights=heap:65,metaspace:10,native:15,stack:10 -memoryInitials=heap:100%,metaspace:100% -stackThreads=300 -totMemory=$MEMORY_LIMIT) && JAVA_OPTS="-Djava.io.tmpdir=$TMPDIR -XX:OnOutOfMemoryError=$PWD/.java-buildpack/open_jdk_jre/bin/killjava.sh $CALCULATED_MEMORY" && SERVER_PORT=$PORT eval exec $PWD/.java-buildpack/open_jdk_jre/bin/java $JAVA_OPTS -cp $PWD/. org.springframework.boot.loader.WarLauncher`

Showing health and status for app Cloudsoft Service Broker in org cloudsoft / space dev as admin...
OK

requested state: started
instances: 1/1
usage: 1G x 1 instances
urls: cloudsoft-service-broker.bosh-lite.com
last uploaded: Tue Sep 20 20:36:06 UTC 2016
stack: cflinuxfs2
buildpack: container-customizer=1.0.0_RELEASE java-buildpack=v3.8.1-https://github.com/cloudfoundry/java-buildpack.git#29c79f2 java-main open-jdk-like-jre=1.8.0_91-unlimited-crypto open-jdk-like-memory-calculator=2.0.2_RELEASE spring-auto-reconfiguration=1.10.0_R...

     state     since                    cpu    memory         disk      details
#0   running   2016-09-20 09:42:18 PM   0.0%   525.3M of 1G   0 of 1G

As you can see, the CSB has been successfully started.

You can now access the Cloudsoft Service Broker web interface at http://cloudsoft-service-broker.bosh-lite.com.

The login credentials you need are the values from the manifest.yml you configured the the Install CSB step for:

  • SECURITY_USER_NAME
  • SECURITY_USER_PASSWORD

Note: For non-production Cloud Foundry instances, you may need to run the following command to workaround any problems with a self-signed SSL certificate when accessing bosh-lite over https. To do so, you can connect without checking the certificate:

cf set-env "Cloudsoft Service Broker" SPRING_PROFILES_ACTIVE development
cf restage "Cloudsoft Service Broker"

Next

You are now ready to explore the Cloudsoft Service Broker application - a great place to start is the Databases view.