Code Monkey home page Code Monkey logo

worlds-simplest-service-broker's Introduction

World's Simplest Service Broker

If you have a shared service such as Hadoop where all applications will ultimately bind to the same service with the same credentials then you have found the service broker for you - the World's Simplest Service Broker for Kubernetes/Service Catalog and for Cloud Foundry.

You configure it with a simple environment variable CREDENTIALS (the same JSON object that will be returned for all service bindings); and then register it as a service broker.

All services created and all service bindings will be given the same set of credentials. Definitely the simplest thing that could work.

As a user of the broker in Kubernetes with Service Catalog:

svcat provision myservice --class some-service-name --plan shared
svcat bind some-service-name
kubectl get secrets some-service-name

As a user of the broker in Cloud Foundry:

cf cs myservice some-service-name
cf bs my-app some-service-name
cf restage my-app

Deploy to Kubernetes & Integrate with Service Catalog

See helm/worlds-simplest-service-broker/README.md for instructions on configuration & deploying the broker to Kubernetes with Helm, plus instructions for integrating and using the broker with Service Catalog.

Deploy to Cloud Foundry & Integrate with Cloud Foundry

See README_CLOUDFOUNDRY.md for instructions on configuration & deploying the broker to Cloud Foundry, plus instructions for integrating and using the broker within Cloud Foundry.

Build and run locally

export BASE_GUID=$(uuid)
# or
export BASE_GUID=$(uuidgen)

export CREDENTIALS='{"port": "4000", "host": "1.2.3.4"}'
export SERVICE_NAME=myservice
export SERVICE_PLAN_NAME=shared
export TAGS=simple,shared
export AUTH_USER=broker
export AUTH_PASSWORD=broker
go run cmd/worlds-simplest-service-broker/main.go

Docker

Below are sections on building and running with OCI/Docker.

Cloud Native Buildpacks

You can compile this project and produce an OCI/Docker image with Cloud Native Buildpacks pack CLI:

pack build cfcommunity/worlds-simplest-service-broker --builder cloudfoundry/cnb:tiny

NOTE: the CI pipeline uses this method to create OCI/docker images.

Whilst the resulting OCI is larger (docker images says 39MB vs 19MB for docker build), the image includes a lot of metadata about the tools used to build the application, and supports the pack rebase command to allow operators to update the base run image over time without ever needing the OCI to be rebuilt or redistributed. Read https://buildpacks.io/ for more.

Docker Build

The project also contains a Dockerfile for docker build:

docker build -t cfcommunity/worlds-simplest-service-broker .

Docker Run

Either create the OCI/Docker image as above, or pull down from Docker Hub, and then run using the same env vars from above:

docker run -e BASE_GUID=$BASE_GUID \
    -e CREDENTIALS=$CREDENTIALS \
    -e SERVICE_NAME=$SERVICE_NAME \
    -e SERVICE_PLAN_NAME=$SERVICE_PLAN_NAME \
    -e TAGS=$TAGS \
    -e AUTH_USER=broker -e AUTH_PASSWORD=broker \
    -p 3000:3000 cfcommunity/worlds-simplest-service-broker

worlds-simplest-service-broker's People

Contributors

bkrannich avatar drnic avatar gberche-orange avatar geofffranks avatar joek avatar lnguyen avatar obeyler avatar skibum55 avatar starkandwayne-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

worlds-simplest-service-broker's Issues

syslog drain url does not work

I added this to manifest:
SYSLOG_DRAIN_URL: 'syslog://log-test:5140'
but when I create the service instance and bind to app the services syslog drain url is empty.
I would like to use this service for central log drain and not use user defined service.

[dev] consider building docker image with `pack build` instead of Dockerfile

Support on master and go-modules branches.

  • Test on cloudfoundry/cnb:cflinuxfs3 builder

  • Test on cloudfoundry/cnb:tiny builder.

    $ pack build cfcommunity/worlds-simplest-service-broker --builder cloudfoundry/cnb:tiny
    $ docker images cfcommunity/worlds-simplest-service-broker
    REPOSITORY                                   TAG                 IMAGE ID            CREATED             SIZE
    cfcommunity/worlds-simplest-service-broker   latest              d55d05464b28        5 minutes ago       39.2MB
    
  • Update README for build instructions

  • Update CI to use concourse-pack-resource

FEATURE: could you add an option to enable or not the user/password

I trying to expose the service of the world simpliest service broker with trafik ingress controller.
I need to have the service without basic auth because the ingress rule already have the auth mecanism.
Is it possible to had this option inside the helm chart to have a way to disable the user/password check inside the pod as it s done by the ingress controller ?
Best regards

k8s 1.19 compatibility

The helm chart wont install on k8s 1.19 (https://github.com/orange-cloudfoundry/k3s-boshrelease )

Guess this is k8s 2 versions policy support which blocks old api versions

first try failed: helm upgrade --install --atomic --cleanup-on-fail --version=1.3.3 --namespace o-kkkkkkk-aaaa-aaaa-aaaa-aaaaaaaaaaaa simplest-broker https://github.com/cloudfoundry-community/worlds-simplest-service-broker/releases/download/v1.3.3/worlds-simplest-service-broker-1.3.3.tgz  -f /tmp/chart_simplest-broker.yml
Release "simplest-broker" does not exist. Installing it now.
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Deployment" in version "apps/v1beta2"
retry 1

`` 

Unable to use your Helm S3 repo

$ helm repo add starkandwayne s3://helm.starkandwayne.com/charts
Error: Could not find protocol handler for: s3
$ helm plugin install https://github.com/hypnoglow/helm-s3.git
Downloading and installing helm-s3 v0.8.0 ...
Checksum is valid.
Installed plugin: s3
$ helm repo add starkandwayne s3://helm.starkandwayne.com/charts
fetch from s3: fetch object from s3: MissingRegion: could not find region configuration
Error: Looks like "s3://helm.starkandwayne.com/charts" is not a valid chart repository or cannot be reached: plugin "bin/helms3" exited with error

Have you another way to reach your helm chart ?

worlds-simplest-service-broker is not compliant with cloud foundry documentation

CF documentation says:
"If the broker does not include requires: syslog_drain, and the bind request returns a value for syslog_drain_url, Cloud Foundry will return an error for the bind operation."

wssb catalog endpoint does not contain requires: syslog_drain but wssb returns empty syslog_drain_url when binding creation is requested. This causes errors in cloud foundry controller.

Do we really need to have syslog_drain_url in the struct below?

type serviceBindingResponse struct {
    Credentials    map[string]interface{} `json:"credentials"`
    SyslogDrainURL string                 `json:"syslog_drain_url"`
}

For me problems emerged for me when I used CF v211.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.