{"id":19040832,"url":"https://github.com/cloudfoundry/service-fabrik-broker","last_synced_at":"2025-12-15T01:02:55.367Z","repository":{"id":36967665,"uuid":"68716409","full_name":"cloudfoundry/service-fabrik-broker","owner":"cloudfoundry","description":"Cloud Foundry service broker which provisions service instances as Docker containers and BOSH deployments.","archived":false,"fork":false,"pushed_at":"2024-11-13T04:20:26.000Z","size":23509,"stargazers_count":41,"open_issues_count":32,"forks_count":50,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-01-22T13:07:16.937Z","etag":null,"topics":["cff-wg-service-management"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudfoundry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"docs/support-for-kubeconfig-rotation-of-cluster.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-20T13:48:13.000Z","updated_at":"2024-06-03T14:12:14.000Z","dependencies_parsed_at":"2024-01-30T04:28:26.679Z","dependency_job_id":"338fec19-d8de-4bd4-b5d9-8e9728b0d405","html_url":"https://github.com/cloudfoundry/service-fabrik-broker","commit_stats":null,"previous_names":["cloudfoundry-incubator/service-fabrik-broker"],"tags_count":206,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fservice-fabrik-broker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fservice-fabrik-broker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fservice-fabrik-broker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fservice-fabrik-broker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudfoundry","download_url":"https://codeload.github.com/cloudfoundry/service-fabrik-broker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236345679,"owners_count":19134307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cff-wg-service-management"],"created_at":"2024-11-08T22:25:41.173Z","updated_at":"2025-10-13T12:30:59.525Z","avatar_url":"https://github.com/cloudfoundry.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Coverage Status](https://coveralls.io/repos/github/cloudfoundry/service-fabrik-broker/badge.svg?branch=master)](https://coveralls.io/github/cloudfoundry/service-fabrik-broker?branch=master) [![Travis Build Status](https://app.travis-ci.com/cloudfoundry/service-fabrik-broker.svg?branch=master)](https://app.travis-ci.com/cloudfoundry/service-fabrik-broker) [![Go Report Card](https://goreportcard.com/badge/github.com/cloudfoundry-incubator/service-fabrik-broker)](https://goreportcard.com/report/github.com/cloudfoundry-incubator/service-fabrik-broker)[![codecov](https://codecov.io/gh/cloudfoundry/service-fabrik-broker/branch/master/graph/badge.svg)](https://codecov.io/gh/cloudfoundry/service-fabrik-broker) [![yarn](https://img.shields.io/badge/maintained%20with-yarn-cc00ff.svg)](https://yarnpkg.com/)\n\n# Service Fabrik Broker aka Interoperator\n\n*Service Fabrik Broker* is an OSBAPI compliant broker which is deployed using BOSH and supports BOSH based and Docker based service deployment. The OSB broker is written in an operator pattern so that it can be used also as a broker for exposing Kubernetes native services written based on operator based pattern in an OSBAPI based way. This flavor of the broker is deployed using helm-chart on Kubernetes and is called as *Interoperator*.\nThis broker was very initially inspired  by the [cf-containers-broker](https://github.com/cloudfoundry-community/cf-containers-broker). Read the [Big Picture](https://github.com/SAP/service-fabrik-broker/wiki/Big-Picture) behind Service Fabrik Broker.\n\nIn the next sections we first discuss about the Deployment layout of BOSH based flavor, Service Fabrik Broker and then the architecture of Interoperator, deployed on Kubernetes.\n\n## Service Fabrik Broker Deployment Layout\n\n![Missing](https://github.com/cloudfoundry/service-fabrik-broker/blob/gh-pages/img/SF2.0-tam-block-diagram-overview.png?raw=true)\nAbove is the component diagram of Service Fabrik.\nService Fabrik has been re-designed to a model which is event driven and based on decoupled components which participate and communicate via an [APIServer](https://kubernetes.io/docs/concepts/overview/kubernetes-api/) managed by Service Fabrik. \n\nThe concept is based on Event Sourcing where the Event Store is point of coordination for different components. This facilitates easy onboarding of external components and modules into the service Fabrik eco-system.\n\nTo facilitate plugging in external components, we intend to model service Fabrik on a resource and control loop based programming model.\n\nThis allows capabilities like provisioning and operations on provisioned instances to be built independently and plugged into the Service Fabrik APIServer based on specific requirements.\n\nSteps to Integrate new provisioners are mentioned in [here](https://github.com/cloudfoundry/service-fabrik-broker/blob/master/docs/SF2.0.md)\n\n## Interoperator Architecture\n\nInteroperator Architecture is the heart of the OSB framework of Service Fabrik. The details are discussed [here](https://github.com/cloudfoundry/service-fabrik-broker/blob/master/docs/Interoperator.md).\n\n## Deploy Interoperator\n\n### Pre-requisites\nInteroperator uses helm charts for deployment. Interoperator requires **helm version \u003e= 3.0.0**, and is **not supported by helm 2**.\n\n#### Deploy and run your operator\n\nYou have to deploy and run your own operator. Currently SF-Inter-Operator supports only in-cluster operators, so you have to deploy it in the same cluster where SF-Inter-Operator is deployed.\n\n**NOTE:** It is suggested for Gardener users to refer [this](./docs/Interoperator-Features.md#automatic-kubeconfig-rotation-of-clusters) before either Fresh Deployment or Update of Interoperator\n\n### Deploy Interoperator(Fresh deploy)\n\n#### Deploy using publicly published helm chart (Recommended)\nTo add service fabrik interoperator helm chart repo\n```shell\nhelm repo add interoperator-charts https://cloudfoundry.github.io/service-fabrik-broker/helm-charts\nhelm repo update\n```\n\nDeploy SF Interoperator using helm\n```shell\nhelm install --set cluster.host=sf.ingress.\u003c clusterdomain \u003e --namespace interoperator [--version \u003chelm chart version\u003e] interoperator interoperator-charts/interoperator\n```\n\n#### Deploy using helm chart repo\nTo deploy using helm chart repo\n```\ngit clone https://github.com/cloudfoundry/service-fabrik-broker\nhelm install --set cluster.host=sf.ingress.\u003c clusterdomain \u003e --namespace interoperator interoperator helm-charts/interoperator\n```\n\n**NOTE:** `cluster.host` should be within the [63 character limit](http://man7.org/linux/man-pages/man7/hostname.7.html).\n\n### Upgrade existing Interoperator deployment\n\nTo check how you can upgrade existing interoperator deployment, please check this document [here](https://github.com/cloudfoundry/service-fabrik-broker/blob/master/docs/interoperator-upgrades.md).\n\n### Deploy SFClusters, SFServices and SFPlans and Register with Interoperator\n\nPlease create sfcluster CRs and add reference to kubeconfig. In the example below, resource_v1alpha1_sfcluster.yaml is the sfcluster CR which refers to secret kubeconfig-secret.yaml, which has the current cluster kubeconfig as the base64 encoded data.\n\nFor multi-cluster support, all corresponding sfcluster CRs need to be created and their kubeconfig needs to be supplied in the corresponding secret.\n\nPlease note that `sfservice`, `sfplans` and `sfcluster` (along with the `secret` it refers to) need to be deployed in the same namespace where SF is deployed (default is `interoperator`).\n\nTo understand the CRs and their structures, please check the Architecture. The different templates are described in [interoperator-templates](https://github.com/cloudfoundry/service-fabrik-broker/blob/master/docs/Interoperator-templates.md)\n\n### Deploying multiple interoperator in the same cluster\n\nMultiple instances of interoperator can be deployed on a single cluster. But each instance must be deployed in a separate namespace. Only one instance of interoperator can be deployed in one namespace. The the custom resources like `sfservice`, `sfplans` and `sfcluster` (along with the `secret` it refers to) related on deployment of interoperator must be created in the namespace where interoperator is deployed. \n\nDeploy an instance of interoperator on a cluster using\n```shell\nhelm install --set cluster.host=sf.ingress.\u003c clusterdomain \u003e  --namespace \u003c namespace \u003e [--version \u003chelm chart version\u003e] interoperator interoperator-charts/interoperator\n```\n\n\n### Register with the platform\n\nYou can either register with service manager which then exposes it to consuming environments or register with service catalog to expose in local kubernetes cluster.\n\n## Other Features\n\nCheckout other features like enabling Service Instance sharing, custom service dashboard and quota management [here](https://github.com/cloudfoundry/service-fabrik-broker/blob/master/docs/Interoperator-Features.md).\n\n## [Releases](https://github.com/cloudfoundry/service-fabrik-broker/releases)\n\n## Local Development Setup (Ubuntu)\n\nCertainly when you are a broker developer, but also if you are a service developer, you may want to work locally with the broker without packaging it into a Bosh release and deploying it. As a pre-requisites, you would need to have the following installed.\n\n#### Installing NVM and Running Node Processes\n\nNVM helps you manage node versions and isolated environments.\n\n* Follow instructions at https://github.com/creationix/nvm/#install-script\n```shell\ncurl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash\nsource ~/.nvm/nvm.sh\nnvm install node\nnvm use node\n```\n\n\n* Clone this repo (assuming your working directory is ~/workspace)\n```shell\ncd ~/workspace\n```\n* Clone and setup fork and git-secrets ( requires [hub] and [git secrets] to be\n  installed)\n  ```\n  sh -c \"$(curl -fsSL https://raw.githubusercontent.com/cloudfoundry/service-fabrik-broker/master/broker/bin/clone-for-development)\"\n  cd service-fabrik-broker/broker\n  git checkout -b my-new-feature\n  # make code changes\n  git push \u003cgithub_username\u003e my-new-feature\n  ```\n* Install dependencies. Service Fabrik follows monorepo pattern and uses yarn for managing dependencies. Please follow these steps to install required dependencies.\n```shell\ncd service-fabrik-broker/broker\nnpm install -g yarn\nyarn set version 2.4.1\nyarn install\n```\n* Optional: To locally run all unit test\nTo run all the unit tests:\n```shell\nnpm run -s test\n```\nTo run only unit tests for specific processes like broker, deployment_hooks\n```shell\n# help\nnpm run -s help\n```\n\n* Launch the broker process\n[APIServer](https://kubernetes.io/docs/concepts/overview/kubernetes-api/) is a prerequisite for the Service Fabrik. To get more details about the APIs, [this](https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md) can be looked into.\n\nAssuming that apiserver is already deployed on boshlite, to start provisioning, broker process has to be started.\n\nIf apiserver is not deployed already, please follow [this](https://github.com/cloudfoundry-incubator/service-fabrik-boshrelease#deploying-apiserver) guide.\n\nUseful prerequisites: When working with the broker, install `curl` (`sudo apt-get install curl`), [`jq`](https://stedolan.github.io/jq/download), and [`yaml2json`](https://github.com/bronze1man/yaml2json).\n\nDependencies on other processes: broker process is dependent on deployment hooks process which has to be running for broker to run any lifecycle operation if actions are present in service catalogs.\n\nBefore starting broker process SETTINGS_PATH env variable has to be set.\n```shell\nexport SETTINGS_PATH=$(pwd)/config/settings.yml\n```\nIf you need  to change the `settings.yml` configuration you should copy the file and point the broker to your settings file via the environment variable `SETTINGS_PATH`.\n```shell\n# env vars you may like to set to different than these default values\n# export NODE_ENV=development ## For bosh2.0, use the environment boshlite2, as the passwords and BOSH IP are different.\n# cp $(pwd)/broker/config/settings.yml $(pwd)/broker/config/my-settings.yml\n# export SETTINGS_PATH=$(pwd)/config/my-settings.yml\nnpm run -s start\n```\nCheck endpoint with curl\n```shell\ncurl -sk -u broker:secret -H \"X-Broker-Api-Version: 2.9\" https://127.0.0.1:9293/cf/v2/catalog | jq .\n```\n\n* Launch the Deployment Hooks Process\nThis process executes action scripts provided by services in restricted environment.\nMore information on how to configure action scripts is documented here: https://github.com/cloudfoundry/service-fabrik-broker/wiki/Deployment-hooks-for-service-lifecycle-operations\nIf you don't want any predeployment action to run please comment out `actions` property in [service](https://github.com/cloudfoundry/service-fabrik-broker/blob/rel-2018.T08a/broker/config/settings.yml#L574) and [plan](https://github.com/cloudfoundry/service-fabrik-broker/blob/rel-2018.T08a/broker/config/settings.yml#L685) from catalog.\n\nIf predeployment actions are present in service catalog then deployment hook process has to be running.\nBefore starting deployment hooks process, SETTINGS_PATH env variable has to be set.\n```shell\nexport SETTINGS_PATH=$(pwd)/deployment_hooks/config/settings.yml\n```\nIf you need  to change the `settings.yml` configuration you should copy the file and point the deployment_hooks to your settings file via the environment variable `SETTINGS_PATH`.\n```shell\n# env vars you may like to set to different than these default values\n# export NODE_ENV=development ## For bosh2.0, use the environment boshlite2, as the passwords and BOSH IP are different.\n# cp $(pwd)/deployment_hooks/config/settings.yml $(pwd)/deployment_hooks/config/my-settings.yml\n# export SETTINGS_PATH=$(pwd)/deployment_hooks/config/my-settings.yml\nnode $(pwd)/applications/deployment_hooks/src/HookServer.js\n```\n* Launch the Operators\nFor running lifecycle operations, corresponding operator processes have to be started. Currently Service Fabrik Broker supports Bosh Director based and Docker Based services.\n\nAssuming that all required env variables (SETTINGS_PATH, NODE_ENV) are already set. Both bosh operator and docker operator can be launched.\n```shell\nnode applications/operators/StartBoshOperators.js #to start bosh operator\nnode applications/operators/StartDockerOperators.js #to start docker operator\n```\n\n#### Installing Golang Prerequisites and Running Golang Processes\n\n##### Prerequisites\n\n* Install [kustomize](https://github.com/kubernetes-sigs/kustomize)\n* Install [kubebuilder](https://github.com/kubernetes-sigs/kubebuilder)\n\n```\nversion=2.2.0 # latest stable version\narch=amd64\n\n# download the release\ncurl -L -O https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/kubebuilder_${version}_darwin_${arch}.tar.gz\n\n# extract the archive\ntar -zxvf kubebuilder_${version}_darwin_${arch}.tar.gz\nsudo mv kubebuilder_${version}_darwin_${arch} /usr/local/kubebuilder\n\n# update your PATH to include /usr/local/kubebuilder/bin\nexport PATH=$PATH:/usr/local/kubebuilder/bin\n\ncd interoperator\n\n# install mockgen\ngo get github.com/golang/mock/gomock\ngo get github.com/golang/mock/mockgen\ngo install github.com/golang/mock/mockgen\n\n# update your PATH to include $GOPATH/bin\nexport PATH=$PATH:$GOPATH/bin\n```\n\n##### Get dependencies\n```\ngo mod download\n```\n\n##### Generate the crds and mocks\n\n```\nmake generate manifests\n```\n\n##### Generate clients for crds\n\n```\ngo mod vendor\nbash vendor/k8s.io/code-generator/generate-groups.sh client github.com/cloudfoundry-incubator/service-fabrik-broker/interoperator/pkg/client github.com/cloudfoundry-incubator/service-fabrik-broker/interoperator/api \"osb:v1alpha1 resource:v1alpha1\" --go-header-file hack/boilerplate.go.txt\n```\n\n##### Installing\n\nA step by step series of examples that tell you how to get a development env running\n\nInstalling the CRDs\n\n```\nmake install\n```\n\nRun it locally\n\n```\nexport KUBECONFIG=\u003cpath to kubeconfig\u003e\nexport CLUSTER_ID=\"1\"\nexport POD_NAMESPACE=\"interoperator\" # namespace should exist in the k8s cluster\n\n# To run the provisioner\nmake run_provisioners\n\n# To run the scheduler\nmake run_schedulers\n\n# To run the multiclusterdeploy\nmake run_mcd\n```\n\nIn a new terminal, create an instance of the CRD and check if controller picks it up\n\n```\nkubectl apply -f config/samples/interoperator_v1alpha1_serviceinstance.yaml\n```\n\n#### Installing Docker\n\nThe famous Docker will be required for a local start of the broker. You can avoid this by removing any Docker service defintion from the broker settings/configuration/catalog.\n\n* Follow instructions at https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/\n\nIf you're using a Mac, we recommend to use [Docker for MAC](https://docs.docker.com/docker-for-mac/).\n\n* https://download.docker.com/mac/beta/Docker.dmg\n\nPost installation of docker make modifications to [manage docker as a non-root user](https://docs.docker.com/engine/installation/linux/linux-postinstall/#manage-docker-as-a-non-root-user)\n\n\n## Register the Broker\n\nYou have to do this only once or whenever you modify the catalog. Then of course, use `update-service-broker` instead of `create-service-broker`.\n\n* Registration\n```shell\ncf create-service-broker service-fabrik-broker broker secret https://10.0.2.2:9293/cf # host IP reachable from within the Vagrant box\ncf service-brokers # should show the above registered service broker\ncurl -sk -u broker:secret -H \"X-Broker-Api-Version: 2.9\" https://127.0.0.1:9293/cf/v2/catalog | jq -r \".services[].name\" | xargs -L 1 -I {} cf enable-service-access {}\ncf service-access # should show all services as enabled, cf marketplace should show the same\n```\n\n## Run a Service Lifecycle\n\nYou will need a Cloud Foundry application, let's call it `my-app` (see below). If you have no specific one, you can use our [blueprint-app](https://github.com/sap/service-fabrik-blueprint-app).\n\n```shell\ncf create-service blueprint v1.0-container my-service\ncf bind-service my-app my-service\n# take a look at the generated binding with cf env my-app\ncf restart my-app # do this a.) to make binding information available in environment of the app and b.) to activate the security group created with the service\n# verify the application sees the service; if you have deployed the above app, run curl -skH \"Accept: application/json\" \"https://my-app.bosh-lite.com/test\"\ncf unbind-service my-app my-service\ncf delete-service -f my-service\n```\n## How to obtain support\n\nIf you need any support, have any question or have found a bug, please report it in the [GitHub bug tracking system](https://github.com/cloudfoundry/service-fabrik-broker/issues). You can also reach us out on our [Slack Channel](https://cloudfoundry.slack.com/messages/C814KVC59).\n\n## LICENSE\n\nThis project is licensed under the Apache Software License, v. 2 except as noted otherwise in the [LICENSE](LICENSE) file.\n\n[hub]: https://github.com/github/hub\n[git secrets]: https://github.com/awslabs/git-secrets\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry%2Fservice-fabrik-broker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudfoundry%2Fservice-fabrik-broker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry%2Fservice-fabrik-broker/lists"}