GoogleCloudPlatform/gcp-service-broker

Name: gcp-service-broker

Owner: Google Cloud Platform

Description: Cloud Foundry service broker for Google Cloud Platform services

Created: 2016-09-19 17:24:39.0

Updated: 2018-05-22 21:31:58.0

Pushed: 2018-05-14 21:28:23.0

Homepage:

Size: 869632

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Cloud Foundry Service Broker for Google Cloud Platform

This is the home of the Cloud Foundry Service Broker for Google Cloud Platform. For a demo of installing and using the broker, see here

Background
Service Brokers

This product is a Cloud Foundry Service Broker. It adheres to v2.8 of the Service Broker API.

Google Cloud Platform (GCP)

GCP is a cloud service provider. In addition to VMs and networking, many other useful services are available. The ones available through this Service Broker are:

Installation

Requires Go 1.8 and the associated buildpack.

Installing as a Pivotal Ops Manager tile

Documentation for installing as a Pivotal Ops Manager tile is available here

Installing as a Cloud Foundry Application
Set up a GCP Project
  1. Go to Google Cloud Console and sign up, walking through the setup wizard
  2. Next to the Google Cloud Platform logo in the upper left-hand corner, click the dropdown and select “Create Project”
  3. Give your project a name and click “Create”
  4. When the project is created (a notification will show in the upper right), refresh the page.
Enable APIs

Enable the following services in API Manager > Library.

  1. Enable the Google Cloud Resource Manager API
  2. Enable the Google Identity and Access Management (IAM) API
  3. If you want to enable Cloud SQL as a service, enable the Cloud SQL API
  4. If you want to enable BigQuery as a service, enable the BigQuery API
  5. If you want to enable Cloud Storage as a service, enable the Cloud Storage API
  6. If you want to enable Pub/Sub as a service, enable the Cloud Pub/Sub API
  7. If you want to enable Bigtable as a service, enable the Bigtable Admin API
  8. If you want to enable Datastore as a service, enable the Datastore API
Create a root service account
  1. From the GCP console, navigate to IAM & Admin > Service accounts and click Create Service Account.
  2. Enter a Service account name.
  3. Select the checkbox to Furnish a new Private Key, and then click Create.
  4. Save the automatically downloaded key file to a secure location.
  5. Navigate to IAM & Admin > IAM and locate your service account.
  6. From the dropdown on the right, choose Project > Owner and click Save.
Set up a backing database
  1. Create new MySQL instance
  2. Make sure that the database can be accessed, if you are using GCP cloudsql, add 0.0.0.0/0 as an authorized network.
  3. Run CREATE DATABASE servicebroker;
  4. Run CREATE USER '<username>'@'%' IDENTIFIED BY '<password>';
  5. Run GRANT ALL PRIVILEGES ON servicebroker.* TO '<username>'@'%' WITH GRANT OPTION;
  6. (Optional) create SSL certs for the database and save them somewhere secure
Set required env vars

Add these to the env section of manifest.yml

Optional env vars

See https://github.com/GoogleCloudPlatform/gcp-service-broker/blob/master/docs/customization.md for instructions on providing database name and port overrides, ssl certs, and custom service plans for Cloud SQL, Bigtable, and Spanner.

Push the service broker to CF and enable services
  1. cf push gcp-service-broker
  2. cf create-service-broker <service broker name> <username> <password> <service broker url>
  3. (for all applicable services, e.g.) cf enable-service-access google-pubsub

For more information, see the Cloud Foundry docs on managing Service Brokers

(Optional) Increase the default provision/bind timeout

It is advisable, if you want to use CloudSQL, to increase the default timeout for provision and bind operations to 90 seconds. CloudFoundry does not, at this point in time, support asynchronous binding, and CloudSQL bind operations may exceed 60 seconds. To change this setting, set broker_client_timeout_seconds = 90 in your deployment manifest.

Usage

See https://github.com/GoogleCloudPlatform/gcp-service-broker/blob/master/docs/use.md for instructions on creating and binding to GCP Services

See the examples folder to understand how to use services once they are created and bound.

Commands

The cmd folder contains commands that can be run independent of the broker.

Testing

Production testing for the GCP Service Broker is administered via a private Concourse pipeline.

To run tests locally, use Ginkgo.

Integration tests require the ROOT_SERVICE_ACCOUNT_JSON environment variable to be set.

Note: Integration tests create and destroy real project resources and therefore have associated costs to run

Change Notes

see https://github.com/GoogleCloudPlatform/gcp-service-broker/blob/master/CHANGELOG.md

Support

For functional issues with the service broker or feature requests, please file a github issue here:

https://github.com/GoogleCloudPlatform/gcp-service-broker/issues

They will be prioritized and updated here:

https://github.com/GoogleCloudPlatform/gcp-service-broker/projects/1

For discussions and updates, please subscribe to this group:

https://groups.google.com/forum/#!forum/gcp-service-broker

Contributing

see https://github.com/GoogleCloudPlatform/gcp-service-broker/blob/master/CONTRIBUTING

This is not an officially supported Google product.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.