Agenda
1. Service Broker2. API3. CF vs. K8s4. Demo
2
Agenda
1. Service Broker2. API3. CF vs. K8s4. Demo
3
4
How to use it
9
Service provider:• Implement a service broker
How to use it
10
Platform Operator:• Deploy the service broker cf push• Register the broker
cf create-service-broker SERVICE_BROKER USERNAME PASSWORD URL
• Enable access cf enable-service-access myservice
How to use it
11
Developer:
> cf marketplace> cf create-service p-mysql free mydb> cf bind-service myapp mydb> cf restart myapp
How to use it
12
> cf marketplace bogon:src pivotal$ cf marketplaceGetting services from marketplace in org Test / space Test as admin...OK
service plans descriptionp-mysql 100mb, 1gb, 20gb MySQL databases on demandp-rabbitmq standard RabbitMQ is a robust and scalable high-performance multi-protocol messaging broker.p-redis dedicated-vm Redis service to provide a key-value storecleardb spark, boost*, amp* Highly available MySQL for your Apps.
How to use it
13
> cf marketplace> cf create-service p-mysql 1gb mydb> cf bind-service myapp mydb> cf restart myapp
14
"VCAP_SERVICES": { "p-mysql": [ { "credentials": { "hostname": "...", "jdbcUrl": "...", "name": "...", "password": "...", "port": "...", "uri": "...", "username": "..." }, .... }
How does the app use the database?
➢ Standard➢ Portable➢ Simplify➢ Reuse
https://www.openservicebrokerapi.org/
Agenda
1. Service Broker2. API3. CF vs. K8s4. Demo
18
Service Broker
19
○ Catalog of service & plans○ Provision ○ Bind○ Unbind○ Deprovision ○ …...
Service Broker
20
Broker API
cloud controller
DB
broker
cf create-service-broker
GET /v2/catalog
200 OK
{ “services”: [ “name”: “myService”, “plans”: [ { “name”: “plan1”, … }, ... ]}
cf marketplace
service plans descriptionmyService plan1, plan2 super sweet service
Broker API
cloud controller
DB
broker
cf create-service-broker
GET /v2/catalog
200 OK
cf create-service dummy small myDBPUT /v2/service_instances/:guid
201 CREATEDcf services
name service plan bound appsmyDB dummy small
{ “dashboard_url”:“https://...”}
Broker API
cloud controller
DB
broker
cf create-service-broker
GET /v2/catalog
200 OK
cf create-service dummy small myDBPUT /v2/service_instances/:guid
201 CREATED
name service plan bound appsmyDB dummy small myBoundApp
cf bind-servicePUT /v2/service_instances/:guid/service_bindings/:guid
201 CREATED
{ “credentials”: { “user”: “myUser”, “password”: “sekrit” }}
cf services
Agenda
1. Service Broker2. API3. CF vs. K8s4. Demo
24
Kubernetes Service Catalog
https://github.com/kubernetes-incubator/service-catalog
K8s● kubectl plugin svcat
provision mydb --class=mysql --plan=default
● kubectl plugin svcat bind mydb --name=binding --secret-name=creds
● kubectl create -f kube/myapp.yaml
CF● cf push myapp● Cf create-service
mysql default mydb● cf bind-service
myapp mydb● cf restart myapp
How to use it
26
Pivotal PCF + AWS Services
GCP Service Broker
1. Google Cloud Storage2. Google BigQuery3. Google PubSub4. Google Cloud SQL5. Google Machine Learning APIs6. Google Bigtable7. Google Spanner8. Stackdriver Debugger9. Stackdriver Trace
10.
https://github.com/GoogleCloudPlatform/gcp-service-broker
Azure service broker
● Azure Storage Service● Azure Redis Cache Service● Azure DocumentDB Service● Azure Service Bus and Event Hub Service● Azure SQL Database Service
https://github.com/Azure/meta-azure-service-broker
Agenda
1. Service Broker2. API3. CF vs. K8s4. Demo
30
Resource
1. https://www.openservicebrokerapi.org/2. https://github.com/openservicebrokerapi/servicebroker3.
31
background image: 960x540 pixels - send to back of slide and set to 80% transparency