How to Build Spring Services for Cloud-Native
Platforms Using the Open Service Broker API
Matt McNeeney @1mattmc
Sam Gunaratne @sam_gun
Introductions
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Agenda
• Why do we need services?
• What are service brokers?
• What is the Open Service Broker API?
• Live demo!
@1mattmc
@sam_gun
Why do we need services?
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Rule #1: Applications have dependencies
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Rule #2: Not all development time is spent equal
user-value

line
Improvesyourproduct
Doesn’timproveyourproduct
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Rule #3: Leave it to the experts
@1mattmc
@sam_gun
What are service brokers?
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Platform
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Platform
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Platform Broker
@1mattmc
@sam_gun
Broker
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Platform Broker
Create a new
service instance
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Platform Broker ???
Create a new
service instance
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
> CREATE DB
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Platform Broker
App 1 App 2 App 3
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Platform Broker
App 1 App 2 App 3
Create a new
service binding
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Platform Broker
App 1 App 2 App 3
{
“uri”: “mysql://...",
“username”: “admin”,
“password”: “password”
}
Create a new
service binding
@1mattmc
@sam_gun
What is the Open Service Broker API?
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
@1mattmc
@sam_gun
Service Broker API
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Allows software vendors a single, simple and elegant way
to deliver their services to applications and containers.
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
How do I build one?
GET /v2/catalog
1. What services do you offer?
{
"services": [
{
"id": "123",
"name": "my-broker",
"description": “This is so simple.",
"plans": [{
"id": “456",
"name": "simple",
"description": "A very simple plan.",
"free": true
}]
}
]
}
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
How do I build one?
2. Create a new service instance
POST /v2/service_instances/:id
{}
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
How do I build one?
3. Give me access to the service instance
POST /v2/service_instances/:id/service_bindings/:id
{
"credentials": {
"uri": “mysql://...”,
"username": "admin",
"password": "password",
"port": 3306
}
}
Live demo!
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Hi, I’m Sam!
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Service
broker
Hi, I’m Sam!
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Service
broker
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Service
broker
Register the
service broker
Register the
service broker
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Service
broker
Register the
service broker
Register the
service broker
marketplace cluster resources
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Service
broker
marketplace cluster resources
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Service
broker
Create a new
service instance
Create a new
service instance
marketplace cluster resources
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Service
broker
Service instance Service instance
Create a new
service instance
Create a new
service instance
marketplace cluster resources
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Service
broker
Service instance Service instance
marketplace cluster resources
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Service
broker
Service instance Service instance
Create a new
service binding
Create a new
service binding
marketplace cluster resources
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Service
broker
Service instance Service instance
Create a new
service binding
Create a new
service binding
marketplace cluster resources
@1mattmc
@sam_gun
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Service
broker
Service instance Service instance
Create a new
service binding
Create a new
service binding
marketplace cluster resources
service key secret
@1mattmc
@sam_gun
Go go go…
@1mattmc
@sam_gun
Learn More. Stay Connected.
https://www.openservicebrokerapi.org/
https://github.com/openservicebrokerapi/servicebroker
Weekly call on Tuesdays @ 9am PST
#springone@s1p
@1mattmc
@sam_gun

How to build Spring services for Cloud Native platforms using the Open Service Broker API

  • 1.
    How to BuildSpring Services for Cloud-Native Platforms Using the Open Service Broker API Matt McNeeney @1mattmc Sam Gunaratne @sam_gun
  • 2.
  • 3.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Agenda • Why do we need services? • What are service brokers? • What is the Open Service Broker API? • Live demo! @1mattmc @sam_gun
  • 4.
    Why do weneed services? @1mattmc @sam_gun
  • 5.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Rule #1: Applications have dependencies @1mattmc @sam_gun
  • 6.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Rule #2: Not all development time is spent equal user-value
 line Improvesyourproduct Doesn’timproveyourproduct @1mattmc @sam_gun
  • 7.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Rule #3: Leave it to the experts @1mattmc @sam_gun
  • 8.
    What are servicebrokers? @1mattmc @sam_gun
  • 9.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Platform @1mattmc @sam_gun
  • 10.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Platform @1mattmc @sam_gun
  • 11.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Platform Broker @1mattmc @sam_gun Broker
  • 12.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Platform Broker Create a new service instance @1mattmc @sam_gun
  • 13.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Platform Broker ??? Create a new service instance @1mattmc @sam_gun
  • 14.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ @1mattmc @sam_gun
  • 15.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ @1mattmc @sam_gun
  • 16.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ @1mattmc @sam_gun
  • 17.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ > CREATE DB @1mattmc @sam_gun
  • 18.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ @1mattmc @sam_gun
  • 19.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ @1mattmc @sam_gun
  • 20.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ @1mattmc @sam_gun
  • 21.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ @1mattmc @sam_gun
  • 22.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Platform Broker App 1 App 2 App 3 @1mattmc @sam_gun
  • 23.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Platform Broker App 1 App 2 App 3 Create a new service binding @1mattmc @sam_gun
  • 24.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Platform Broker App 1 App 2 App 3 { “uri”: “mysql://...", “username”: “admin”, “password”: “password” } Create a new service binding @1mattmc @sam_gun
  • 25.
    What is theOpen Service Broker API? @1mattmc @sam_gun
  • 26.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ @1mattmc @sam_gun Service Broker API
  • 27.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ @1mattmc @sam_gun
  • 28.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Allows software vendors a single, simple and elegant way to deliver their services to applications and containers. @1mattmc @sam_gun
  • 29.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ How do I build one? GET /v2/catalog 1. What services do you offer? { "services": [ { "id": "123", "name": "my-broker", "description": “This is so simple.", "plans": [{ "id": “456", "name": "simple", "description": "A very simple plan.", "free": true }] } ] }
  • 30.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ How do I build one? 2. Create a new service instance POST /v2/service_instances/:id {}
  • 31.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ How do I build one? 3. Give me access to the service instance POST /v2/service_instances/:id/service_bindings/:id { "credentials": { "uri": “mysql://...”, "username": "admin", "password": "password", "port": 3306 } }
  • 32.
  • 33.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Hi, I’m Sam! @1mattmc @sam_gun
  • 34.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Service broker Hi, I’m Sam! @1mattmc @sam_gun
  • 35.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Service broker @1mattmc @sam_gun
  • 36.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Service broker Register the service broker Register the service broker @1mattmc @sam_gun
  • 37.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Service broker Register the service broker Register the service broker marketplace cluster resources @1mattmc @sam_gun
  • 38.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Service broker marketplace cluster resources @1mattmc @sam_gun
  • 39.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Service broker Create a new service instance Create a new service instance marketplace cluster resources @1mattmc @sam_gun
  • 40.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Service broker Service instance Service instance Create a new service instance Create a new service instance marketplace cluster resources @1mattmc @sam_gun
  • 41.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Service broker Service instance Service instance marketplace cluster resources @1mattmc @sam_gun
  • 42.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Service broker Service instance Service instance Create a new service binding Create a new service binding marketplace cluster resources @1mattmc @sam_gun
  • 43.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Service broker Service instance Service instance Create a new service binding Create a new service binding marketplace cluster resources @1mattmc @sam_gun
  • 44.
    Unless otherwise indicated,these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Service broker Service instance Service instance Create a new service binding Create a new service binding marketplace cluster resources service key secret @1mattmc @sam_gun
  • 45.
  • 46.
    Learn More. StayConnected. https://www.openservicebrokerapi.org/ https://github.com/openservicebrokerapi/servicebroker Weekly call on Tuesdays @ 9am PST #springone@s1p @1mattmc @sam_gun