GithubHelp home page GithubHelp logo

samze / overview-broker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloudfoundry/overview-broker

0.0 1.0 0.0 651 KB

A simple service broker that provides an overview of it's service instances and bindings.

License: MIT License

JavaScript 91.09% HTML 7.41% CSS 1.50%

overview-broker's Introduction

Overview Broker

Build Status

Open Service Broker API

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.

Installation

npm install

Running

npm start

Tests

npm test

Configuration

  • To set the BasicAuth credentials, set the BROKER_USERNAME and BROKER_PASSWORD environmental variables. Otherwise the defaults of admin and password will be used.
  • To expose a syslog drain service, set the EXPOSE_SYSLOG_DRAIN_SERVICE environmental variable to true.
  • To expose a volume mount service, set the EXPOSE_VOLUME_MOUNT_SERVICE environmental variable to true.
  • To generate lots of plans with example configuration schemas, set the ENABLE_EXAMPLE_SCHEMAS environmental variable to true.
  • To show fake data in the dashboard UI, set the FAKE_DATA environmental variable to true.

Platforms

Cloud Foundry

1. Deploying the broker
  • 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
2. Registering the broker
  • 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.
3. Creating a service instance
  • Now for the exciting part... it's time to create a new service instance:
    cf create-service overview-broker simple my-broker
    You can give your service a specific name in the dashboard by providing the name configuration parameter:
    cf create-service overview-broker simple my-broker -c '{ "name": "My Broker" }'
    Or, if you like all the colours of the rainbow...
    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!

Kubernetes

1. Deploying the broker
  • 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:
    wget https://raw.githubusercontent.com/mattmcneeney/overview-broker/master/examples/kubernetes/Dockerfile
    eval $(minikube docker-env)
    docker build -t overview-broker:v1 .
    If you already have Docker installed and running on your machine and want to use that daemon again, just run:
    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:
    kubectl run overview-broker --image=overview-broker:v1 --port=8080 --env="PORT=8080"
    You can check the deployment has succeeded by running kubectl get deployments and kubectl 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
2. Registering the 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:
    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
    If everything installed successfully, then you should see the following:
    $ 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 by minikube service overview-broker --url):
    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'
    Now create the resource with:
    kubectl create -f overview-broker.yaml
    Check the status of the broker with:
    kubectl get clusterservicebrokers overview-broker -o yaml
    Your broker should also appear in the output from:
    kubectl get clusterserviceclasses
3. Creating a service instance

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:
    wget https://raw.githubusercontent.com/mattmcneeney/overview-broker/master/examples/kubernetes/overview-broker-instance.yaml
    kubectl create -f overview-broker-instance.yaml
    Check everything has worked with:
    kubectl get serviceinstances overview-broker-instance -o yaml
    You should see a message saying "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!

overview-broker's People

Contributors

mattmcneeney avatar samze avatar

Watchers

James Cloos avatar

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.