A demonstration cloud foundry service broker that can be used to integrate cf applications with postgres databases.
This broker requires redis. The build requires maven and JDK 8.
- clone the repo
git clone git@github.com:cf-platform-eng/my-postgres-broker.git
cd my-postgres-broker
- Build the broker
mvn clean install
There are two ways to install the broker: via a tile, or by pushing it as an app and registering it via the cf cli.
- See the information here about creating a tile from source.
- Install and configure the tile in the usual fashion using Operations Manager.
-
edit the manifest file to match your postgres environment.
-
The broker requires a redis datastore. To set this up:
cf create-service p-redis shared-vm redis-for-postgres
- The broker makes use of spring-security to protect itself against unauthorized meddling. To set its username and password edit the manifest.yml) file as needed for your CF install (you probably don't want to check this in!).
- Push the broker to cf:
cf push
- Register the broker:
cf create-service-broker my-postgres-broker the_broker_user_from_the_manifest the_broker_password_from_the_manifest https://uri.of.your.broker.app
- See the broker:
cf service-brokers
Getting service brokers as admin...
name url
...
my-postgres-broker https://your-broker-url
...
cf service-access
Getting service access as admin...
...
broker: my-postgres-broker
service plan access orgs
postgres SharedVMs
...
cf enable-service-access postgres
Enabling access to all plans of service postgres for all orgs as admin...
cf marketplace
Getting services from marketplace in org your-org / space your-space as you...
OK
service plans description
postgres SharedVMs Hi I'm Mr.Postgres! I share VMs
...
- Create an instance:
cf create-service postgres SharedVMs test-postgres-service
cf s
Getting services in org your-org / space your-space as admin...
OK
name service plan bound apps last operation
test-postgres-service postgres SharedVMs create succeeded