Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

vmware-archive/cloudfoundry-brokers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Steps to start and register Service Broker (Gemfire version) with CloudFoundry. Note, steps 1 and 2 are only required if you are not using a bosh deployment of Gemfire and the Service Broker. See https://github.com/Pivotal-Field-Engineering/gemfire-bosh-release.

  1. The JavaServiceBrokerApplication requires a running gemfire cluster and at least one locator. This project contains a Spring Data for Gemfire configuration and application harness. This server configuration is required because it contains the required gemfire functions and regions for the service broker to operate.
      Start a gemfire locator. For example, from GFSH:
      start locator --name=locator --force=true --mcast-port=0 --log-level=fine
      Start atleast one gemfire server by launching com.pivotal.cloudfoundry.service.broker.gemfire.GemfireServer. You will need the following java properties:
      locators=$LOCATORHOST_PORT:  localhost[10334] is the default.  This is only required if you have a different host/port combo
      gemfire-name=$NAME:  the name of the gemfire server.  gemfire-server is the default
      spring.profiles.active=gemfire-server:  required to activate the appropriate spring profile and gemfire spring beams
  2. Start the JavaServiceBrokerApplication Spring Boot Application with the following java property:
    spring.profiles.active=gemfire-service-broker
  3. Register service broker with CloudFoundry using cf add-service-broker. Make sure your URL/IP for your broker is resolvable by your CloudFoundry env.
    example:
    cf create-service-broker gemfire admin admin http://10.244.0.102:8888
  4. To flip flag on a service plan to be public:
    note: this is required. Without it you will not be able to create an instance of this service. Also, make sure you've logged in using cf login recently as your auth token is only cached for 10 minutes
    GUID=$(cf curl /v2/service_plans -X 'GET' | grep '"guid":' | sed 's/\"guid": //' | tr -d ' ",')
    cf curl /v2/service_plans/$GUID -X 'PUT' -d '{"public":true}'
    
    ** GUID = the GUID in the metadata section returned from /v2/service_plans API invocation

    Helpful CF Web service calls:
    To get list of service plans:
    cf curl GET /v2/service_plans
    

    Example: $ cf curl /v2/service_plans -X 'GET'

    { "total_results": 1, "total_pages": 1, "prev_url": null, "next_url": null, "resources": [ { "metadata": { "guid": "0a1d21f7-6c91-49bd-ab8b-43198ac0f65b", **** This is the value to use **** "url": "/v2/service_plans/0a1d21f7-6c91-49bd-ab8b-43198ac0f65b", "created_at": "2013-12-06T21:38:38+00:00", "updated_at": null }, "entity": { "name": "1GB-replicated", "free": true, "description": "Multi-tenant Gemfire service; 1GB data storage replicated", "service_guid": "0de626d0-fb81-4f42-a3f6-d72d75169918", "extra": "{"cost":"free"}", "unique_id": "4618z98-ab16-3t22-ba6e-1f258d3addz2", "public": false, "service_url": "/v2/services/0de626d0-fb81-4f42-a3f6-d72d75169918", "service_instances_url": "/v2/service_plans/0a1d21f7-6c91-49bd-ab8b-43198ac0f65b/service_instances" } } ] }

    To get the instances provisioned by this service:

    GUID=$(cf curl /v2/service_plans -X 'GET' | grep '"guid":' | sed 's/\"guid": //' | tr -d ' ",')
    cf curl /v2/service_plans/$GUID -X 'GET'
    

    ** GUID = the GUID in the metadata section returned from /v2/service_plans

  5. Create a service instance of Gemfire using cf create-service
    cf create-service pivotal-gemfire 1GB-replicated pivotal-gemfire-1
    

About

Repository for custom cloud foundry service brokers

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages