A go quickstart for creating service brokers that implement the Open Service
Broker API based on
osb-broker-lib. Broker authors
implement an interface that uses the same types as the
go-open-service-broker-client
project.
You should use this project if you're looking for a quick way to implement an Open Service Broker and start iterating on it.
You'll need:
go- A running Kubernetes (or openshift) cluster
- The service-catalog installed in that cluster
If you're using Helm to deploy this project, you'll need to have it installed in the cluster. Make sure RBAC is correctly configured for helm.
You can go get this repo or git clone it to start poking around right away.
The project comes ready with a minimal example service that you can easily deploy and begin iterating on.
$ go get github.com/pmorie/osb-starter-pack/cmd/servicebrokerOr clone the repo:
$ cd $GOPATH/src && mkdir -p github.com/pmorie && cd github.com/pmorie && git clone git://github.com/pmorie/osb-starter-packChange into the project directory:
$ cd $GOPATH/src/github.com/pmorie/osb-starter-packDeploy with Helm and pass custom image and tag name. Note: This also pushes the generated image with docker.
$ IMAGE=myimage TAG=latest make push deploy-helmDeploy to OpenShift cluster by passing a custom image and tag name. Note: You must already be logged into an OpenShift cluster. This also pushes the generated image with docker.
$ IMAGE=myimage TAG=latest make push deploy-openshiftRunning either of these flavors of deploy targets will build the broker binary,
build the image, deploy the broker into your Kubernetes, and add a
ClusterServiceBroker to the service-catalog.
To implement your broker, you fill out just a few methods and types in
pkg/broker package:
- The
Optionstype, which holds options for the broker - The
AddFlagsfunction, which adds CLI flags for an Options - The methods of the
BusinessLogictype, which implements the broker's business logic - The
NewBusinessLogicfunction, which creates a BusinessLogic from the Options the program is run with
- Make it extremely easy to create a new broker
- Have a batteries-included experience that gives you the good stuff right out
of the box, for example:
- Checks on who can make calls to the broker using Kubernetes subject-access-reviews
- Easy on-ramp to instrumenting your broker with Prometheus metrics