cloud-gov / kubernetes-broker

Broker for kubernetes based services
Apache License 2.0
5 stars 6 forks source link

Kubernetes-broker

Deprecated

This release is no longer maintained or used, and is retained for reference purposes only

A better way of deploying clustered services on TAP

This repo contains an broker application, responsible for communication between CloudFoundry and Kubernetes cluster, in order to create Marketplace Services on the Kubernetes existing side-to-side with TAP.

Building instructions

It requires go 1.6, grab it from here: https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz

Please note that shell scripts are provided temporarly for convinience - they will be gone later on.

Cloud foundry installation requirements

Modus Operandi

Upon start, broker scans it's catalog structure (described below), in order to be able to return CF-requested /catalog data.

After that, it listens for 5 possible API calls:

Catalog structure

In broker's directory there is an folder named catalog. It has subdirectories per service. In each service directory, there are two files and a directory per service plan:

Every service plan directory contains:

At this point, please create new services based on the existing ones, as the schema is not stable.

Typical core labels are:

"labels": {
      "org": "$org",
      "space": "$space",
      "catalog_service_id": "$catalog_service_id",
      "catalog_plan_id": "$catalog_plan_id",
      "service_id": "$service_id",
      "idx_and_short_serviceid": "$idx_and_short_serviceid",
      "managed_by": "TAP"
      }

Vars like $random1 to $random9 are being filled with a short random text string.

Implemented Providers and clustered services

Most of our providers works out-of-box, but few of them requires additional configuration. Some clustered services needs access to private or public image repository where builded images can be found.

[Images] (custom_images) can be build using simple docker command

 docker build -t mysql56-cluster .

One has to build provided custom images and provide to broker informations how to connect to repository:

More info can be find on their catalogs:

Log levels

You can set desired log level by setting system variable BROKER_LOG_LEVEL_. Available levels are:

Dynamic services

One can use own image to provide new service offering in catalog. For now there is no persistence for dynamic offering (all information are in memory of broker till it restarts). More information how to add such offerings can be found here

Template-repository and Container-broker Microservices

To run microservices on Kuberentes, following steps are required: