Using YugaByte Service Broker for PCF

This topic describes how developers can use the YugaByte Service Broker for Pivotal Cloud Foundry (PCF).

After installing and configuring YugaByte Service Broker for PCF, developers can create service instances of YugaByte service plans and bind them to their applications using either Apps Manager or the Cloud Foundry Command Line Interface (cf CLI). Binding a YugaByte service instance to an application provides the application with information it can use to store and retrieve information in a YugaByte database.

YugaByte supports Cassandra- and Redis-compliant APIs. For information about using YugaByte with your existing application, see Client Drivers in the YugaByte documentation.

Create and Bind a Service Instance in Apps Manager

To create a YugaByte service instance and service key using Apps Manager, do the following:

  1. Navigate to apps.YOUR-SYSTEM-DOMAIN in a browser and log in to Apps Manager.
  2. Click Marketplace in the left navigation.
  3. Click YugaByte DB from the displayed tiles and click to view the available plans.
  4. Click on the appropriate Select this plan button to select the required YugaByte Service Plan.
  5. In the Instance Name field, enter a name for this specific YugaByte service instance.
  6. Click Show Advanced Options. In the Add Parameters section, add a parameter with name of universe_name and set the value to match the instance name. This would launch a PKS based YugaByte universe and replication factor 3. For more advanced options check YugaByte docs
    Create instance
  7. Click CREATE to launch the YugaByte DB, you should see the confirmation as below.
    Create instance success
  8. Click on the service instance and click CREATE SERVICE KEY and enter a Service Key Name. Then click CREATE.
    Create service key
  9. After the service key is created, you can view the service key cedentials like below.
    Create service credentials

Create and Bind a Service Instance Using the cf CLI

To create a YugaByte service instance and service key using the cf CLI, do the following:

  1. Set your API endpoint to the Cloud Controller of your deployment.

    $ cf api api.YOUR-SYSTEM-DOMAIN --skip-ssl-validation
    Setting api endpoint to api.YOUR-SYSTEM-DOMAIN...
    OK

    api endpoint: https://api.YOUR-SYSTEM-DOMAIN api version: 2.103.0

    Not logged in. Use 'cf login' to log in.

  2. Log in to your deployment and select an org and a space.

    $ cf login
    API endpoint: https://api.YOUR-SYSTEM-DOMAIN
    Email>
    Password>
    Authenticating...
    OK

    Select an org (or press enter to skip): Org>

  3. List the Marketplace services and locate the YugaByte service. The service plans match the namespaces that have been configured on the YugaByte database.

    $ cf marketplace
    Getting services from marketplace in org system / space apps-manager as admin...
    OK

    service plans description yugabyte-db x-small*, small*, medium*, large*, x-large* Service Broker for Managing YugaByte DB

    TIP: Use 'cf marketplace -s SERVICE' to view descriptions of individual plans of a given service.

  4. To view invididual plan descriptions, run:

    $ cf marketplace -s yugabyte-db
    OK
    service plan   description                                    free or paid
    x-small        Cores: 2, Memory (GB): 4                       paid
    small          Cores: 4, Memory (GB): 7                       paid
    medium         Cores: 8, Memory (GB): 15                      paid
    large          Cores: 16, Memory (GB): 15                     paid
    x-large        Cores: 32, Memory (GB): 30                     paid
    

  5. Create an instance of the YugaByte service, specifying both the name of the service plan and the name of the service instance.

    $ cf create-service yugabyte-db PLAN SERVICE_INSTANCE -c '{"universe_name": SERVICE_INSTANCE}'
    

  6. Create a service key for the YugaByte service:

    $ cf create-service-key SERVICE_INSTANCE SERVICE_KEY
    

  7. Get the service key details:

    $ cf service-key SERVICE_INSTANCE SERVICE_KEY
    

Create a pull request or raise an issue on the source for this page in GitHub