Giter Club home page Giter Club logo

bookstore-service-broker's Introduction

Overview

This project implements a sample service broker that adheres to the Open Service Broker API using the Spring Cloud Open Service Broker framework. It can be deployed to either Cloud Foundry or Kubernetes, and can be registered as a service broker to either platform.

Compatibility

Branches:

  • master - reactive, Spring WebFlux version of the sample app based on Spring Cloud Open Service Broker 3.3 and Spring Boot 2.4.

  • SCOSB-3.1.x - reactive, Spring WebFlux version of the sample app based on Spring Cloud Open Service Broker 3.1 and Spring Boot 2.2.

  • SCOSB-2.0.x - imperative, Spring MVC version of the sample app based on Spring Cloud Open Service Broker 2.0.

Getting Started

This service broker manages instances of a bookstore service.

When a service instance is provisioned, a new data structure is allocated in memory.

When a service binding is created, a URL and basic auth credentials are provided in the binding credentials. The bookstore URL and credentials can be used to add, retrieve, delete, and list books in the bookstore. Unique credentials are generated for each service binding.

See the blog post Reactive BookStore Service Broker for more information about the architecture and integration of other Spring projects within this sample app.

Build

This project requires Java 8 at a minimum.

The project is built with Gradle. The Gradle wrapper allows you to build the project on multiple platforms and even if you do not have Gradle installed; run it in place of the gradle command (as ./gradlew) from the root of the main project directory.

To compile the project and run tests

./gradlew build

Deploy

Once the project is built, it can be deployed and registered to either Cloud Foundry or Kubernetes.

bookstore-service-broker's People

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  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

bookstore-service-broker's Issues

Cannot connect to service instance in CF

Hi Team,
I have deployed the broker and service in k8s cluster and registered it in Cloud Foundry. Everything works fine, except that when I try to access the (add book) endpoint from the service-key in CF, I get the following curl error from my local macOS machine:

curl: (7) Failed to connect to <cf_ip_add> port 443: Operation timed out

Any ideas ?

Thanks,
Sundar

Add an option to setup OAuth2 authentication

Make it possible to configure the service broker application with OAuth2 authentication as a configurable option, with basic auth as the default still.

Provide alternate Kubernetes deployment instructions that specify OAuth2 client instead of basic auth credentials when registering the service broker.

Add a provision parameter

Add support for an optional maxBooks provisioning parameter that limits the number of books that a service instance can store. Attempting to add more books than the specified maximum will result in an error from the service instance endpoints.

The broker catalog should include the schema for the parameter.

Add a simple service instance dashboard

An SI dashboard could just display a table with the key/value pairs currently being stored in the SI. It doesn't need to be a fancy UI, just something to demonstrate how dashboard UI endpoints can be added to a broker app.

Simulate async provisioning of service instances

Async provisioning could be simulated with a simple counter (e.g. the first call to /last_operation could return "in progress" and the second call could return "success"), or with an artificial time delay in creating the key/value store.

Error from server (Forbidden): error when creating "deploy/kubernetes/service-broker.yml": clusterservicebrokers.servicecatalog.k8s.io is forbidden: User "system:anonymous" cannot create clusterservicebrokers.servicecatalog.k8s.io at the cluster scope

Rancher versions: 1.6.21
docker version: 17.03.3-ce
Kubernetes: 1.10.5
helm: 2.8.2
Environment :
Opened k8s rbac in rancher;
Virtual Machines
deploy to Kubernetes:https://github.com/spring-cloud-samples/bookstore-service-broker/blob/master/deploy/kubernetes/README.adoc
Register the service broker to the Service Catalog:
$ kubectl create -f deploy/kubernetes/service-broker.yml
Error:
Error from server (Forbidden): error when creating "deploy/kubernetes/service-broker.yml": clusterservicebrokers.servicecatalog.k8s.io is forbidden: User "system:anonymous" cannot create clusterservicebrokers.servicecatalog.k8s.io at the cluster scope

Add a bind parameter

Add support for an optional readonly=true|false bind parameter that controls whether a service binding is allowed to retrieve, list, write, and delete books or only to retrieve and list books.

The broker catalog should include the schema for the parameter.

Unauthorised error

Following the guide to deploy the service broker to PCFDev (v0.29.0 and v0.30.0) running on Linux.
I am not getting the response as expected.

curl https://bookstore-service-broker.local.pcfdev.io/v2/catalog -u admin:admin

curl: (35) You are attempting to import a cert with the same issuer/serial as an existing cert, but that is not the same cert.

curl with insecure setting,
curl -k https://bookstore-service-broker.local.pcfdev.io/v2/catalog -u admin:admin

{"timestamp":"2018-05-01T12:36:33.811+0000","status":401,"error":"Unauthorized","message":"Unauthorized","path":"/v2/catalog"}

Unable to throw 409 Conflict Https status

Hello team,
I am implementing the service broker using Spring.

I have provided an implementation class for ServiceInstanceBindingService.
In this, according to the OSBAPI specification given here
If someone provides already existing bindingId but with different attributes, we should throw 409 status.
But I am unable to find a way to achieve this.
Will you please help me out.

Thanks.

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.