A simple service broker conforming to the Open Service Broker API specification that hosts a dashboard showing information on service instances and bindings created by any platform the broker is registered with.
Fun features this broker provides include:
- Configuration parameter schemas for provision, update and create binding
- Supports asynchronous provisioing, updating and creation of service bindings
- Supports fetching service instances and bindings
The Open Service Broker API project allows developers, ISVs, and SaaS vendors a single, simple, and elegant way to deliver services to applications running within cloud native platforms such as Cloud Foundry, OpenShift, and Kubernetes. The project includes individuals from Fujitsu, Google, IBM, Pivotal, RedHat and SAP.
npm install
npm start
npm test
- To set the BasicAuth credentials, set the
BROKER_USERNAME
andBROKER_PASSWORD
environmental variables. Otherwise the defaults ofadmin
andpassword
will be used. - To expose a syslog drain service, set the
EXPOSE_SYSLOG_DRAIN_SERVICE
environmental variable totrue
. - To expose a volume mount service, set the
EXPOSE_VOLUME_MOUNT_SERVICE
environmental variable totrue
. - To generate lots of plans with example configuration schemas, set the
ENABLE_EXAMPLE_SCHEMAS
environmental variable totrue
. - To show fake data in the dashboard UI, set the
FAKE_DATA
environmental variable totrue
.
- First you will need to deploy the broker as an application:
cf push overview-broker
- You can also use an application manifest to deploy the broker as an
application:
wget https://raw.githubusercontent.com/mattmcneeney/overview-broker/master/examples/cloudfoundry/manifest.yaml cf push
- To register the broker to a space (does not require admin credentials), run:
cf create-service-broker --space-scoped overview-broker admin password <url-of-deployed-broker>
- The overview broker dashboard should now be accessible at
https://<url-of-deployed-broker>/dashboard
.
- Now for the exciting part... it's time to create a new service instance:
You can give your service a specific name in the dashboard by providing the
cf create-service overview-broker simple my-broker
name
configuration parameter:Or, if you like all the colours of the rainbow...cf create-service overview-broker simple my-broker -c '{ "name": "My Broker" }'
cf create-service overview-broker simple my-broker -c '{ "rainbow": true }'
- If you now head back to the dashboard, you should see your new service instance information!
- If you want to deploy the broker on Kubernetes, you will first need to build an
image for the container. If you're using
minikube, you
don't need to push the image to a registry. Instead you can just build the
image using the same Docker host as the minikube VM. To build a container using
the example Dockerfile provided, run:
If you already have Docker installed and running on your machine and want to use that daemon again, just run:
wget https://raw.githubusercontent.com/mattmcneeney/overview-broker/master/examples/kubernetes/Dockerfile eval $(minikube docker-env) docker build -t overview-broker:v1 .
eval $(minikube docker-env -u)
- Now it's time to create a deployment. A Kubernetes deployment manages a pod,
which we want to run our
overview-broker
image:You can check the deployment has succeeded by runningkubectl run overview-broker --image=overview-broker:v1 --port=8080 --env="PORT=8080"
kubectl get deployments
andkubectl get pods
. - In order to access the Pod from outside of the Kubernetes virtual network, you
need to create a service. You can create a load balancer to do this easily:
kubectl expose deployment overview-broker --type=LoadBalancer
- Check your service has been created successfully using
kubectl get services
. You should now be able to access the broker dashboard by running:minikube service overview-broker
To register the broker, you first need to install the Service Catalog using Helm. The instructions to do this are likely to change, so if anything below breaks, then check out the official guide.
- If you don't already have Helm, then follow these
installation instructions to install both Helm and Tiller. If you're on macOS,
the quickest way to do this is:
brew install kubernetes-helm helm init
- The service catalog then needs to be installed and configured with:
If everything installed successfully, then you should see the following:
helm repo add svc-cat https://svc-catalog-charts.storage.googleapis.com kubectl create clusterrolebinding tiller-cluster-admin \ --clusterrole=cluster-admin \ --serviceaccount=kube-system:default # The helm install will fail if we run this immediately. Give tiller # some time to get ready... sleep 30 helm install svc-cat/catalog \ --name catalog --namespace catalog --set insecure=true
$ kubectl get clusterservicebrokers No resources found.
- Finally, you need to register a broker server with the catalog by creating
a new Broker resource. Download the provided manifest (
overview-broker.yaml
) to do this, but be sure to edit the file to update the URL of the broker you have deployed (use the IP address returned byminikube service overview-broker --url
):Now create the resource with:wget https://raw.githubusercontent.com/mattmcneeney/overview-broker/master/examples/kubernetes/overview-broker.yaml # Update <URL> to the output of 'minikube service overview-broker --url'
Check the status of the broker with:kubectl create -f overview-broker.yaml
Your broker should also appear in the output from:kubectl get clusterservicebrokers overview-broker -o yaml
kubectl get clusterserviceclasses
Now that we have the overview-broker
ServiceClass within our cluster's service
catalog, we can provision a new Instance resource.
- Download the provided manfifest (
overview-broker-instance.yaml
) and create a new instance with:Check everything has worked with:wget https://raw.githubusercontent.com/mattmcneeney/overview-broker/master/examples/kubernetes/overview-broker-instance.yaml kubectl create -f overview-broker-instance.yaml
You should see a message sayingkubectl get serviceinstances overview-broker-instance -o yaml
"The instance was provisioned successfully"
. - If you now head back to the dashboard (run
minikube service overview-broker
), you should see your new service instance information!