Page 1
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
SPRINGONE2GXWASHINGTON, DC
Lattice: A Cloud-Native Platform for Your Spring Applications
Matt Stine @mstine
[email protected]
Page 2
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
I wrote a little cloud book…
2
Available to you compliments of Pivotal! !Hard copies available at the Pivotal booth. !Book Signing Wednesday, 4-4:30 PM - Pivotal M4 Lounge !Get the FREE e-book at http://bit.ly/cloud-native-book!
Page 3
Cloud native applications compose simple patterns with predictable performance, scaling, security and failure
characteristics to create solutions to complex problems that can be quickly and flexibly adapted to take
advantage of new information.
Page 4
Cloud native applications compose simple patterns with predictable performance, scaling, security and failure
characteristics to create solutions to complex problems that can be quickly and flexibly adapted to take
advantage of new information.
Page 5
Cloud native applications compose simple patterns with predictable performance, scaling, security and failure
characteristics to create solutions to complex problems that can be quickly and flexibly adapted to take
advantage of new information.
Page 6
Cloud native applications compose simple patterns with predictable performance, scaling, security and failure
characteristics to create solutions to complex problems that can be quickly and flexibly adapted to take
advantage of new information.
Page 7
Cloud native applications compose simple patterns with predictable performance, scaling, security and failure
characteristics to create solutions to complex problems that can be quickly and flexibly adapted to take
advantage of new information.
Page 8
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Some Simple Patterns with Predictable Characteristics
• 12 Factor (http://12factor.net) • REST • Pipes and Filters • Service Discovery • Circuit Breakers
8
Page 9
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Cloud Natives with Complex Problems
9
$3.5B valuation Financial Services
$3.5B valuation Travel & Hospitality
$3.5B valuation Transportation
$3.2B Acquisition by Google Home Automation
$20B valuation Entertainment
$26B valuation Tesla--Automotive
$6B $50B $41B
$25B $33.5B
Page 10
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Microservices: Quick and Flexible Adaptation
10
Loosely coupled service oriented architecture with bounded contexts
If every service has to be updated in concert, it’s not loosely coupled!
If you have to know about surrounding services you don’t have a bounded context.
Page 11
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/ 11
Without taking steps to ensure fault tolerance, 30 dependencies each with 99.99% uptime would result in 2+ hours downtime/month (99.99%30 = 99.7% uptime = 2+ hours downtime in a month).
http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html
Page 12
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/ 12
Build Reliable Systems from
Unreliable Components
Page 13
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/ 13
Continuous Delivery
Page 14
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/ 14
ContinuousDelivery
Page 15
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/ 15
ContinuouslyDeliverDay One Day Two and Beyond
Page 16
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Operations is the Secret Sauce
16
Page 17
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
You are going to need a platform.
17
Page 18
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Cloud Native at Your Service
18
Spring Boot
The Foundation for
Twelve-Factor Apps
Spring Cloud
The Foundation for
Distributed Systems
Pivotal Cloud Foundry
The Foundation for
Containerized Workloads
Page 19
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Let’s Focus on the Elastic Runtime…
19
Pivotal Cloud Foundry
The Foundation for
Containerized Workloads
Page 20
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/ 20
Page 21
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
What problems does it solve?
• role based access to resources
• run code on demand
• coordinate cross service configurations
• route public requests
• read and write persistent data
• add and remove resources
• record internal and external events
• isolate resources and failures
• measure performance/health
• detect and determine failure
(plan & provoke failure)
• recover failures
• work tomorrow
21
Page 22
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Diego
22
a distributed system that orchestrates containerized workloads
Page 23
HA Container Execution Nodes
HA Container Scheduler
and Health Monitor
HA Consistent Shared State
Diego
Page 24
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
What are containers?
24
Resource Isolation
• CPU • Memory • I/O
CGROUPS
Visibility/Access Isolation
• pid • net • ipc • mnt
NAMESPACES
Data Isolation
• immutable root layer • immutable child layers • copy on write layer
UNION FILE SYSTEM
Page 25
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
What is Docker?
25
Docker provides a super easy to grok UX around filesystem image creation and
cgroup/namespace orchestration.
Page 26
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/ 26
Garden API
Garden Linux Garden Windows
Page 27
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
What do we run in containers?
27
TASKS
A Single Unit of Work !!
Runs at Most Once
LRPs
N Long Running Instances
!Distributed Across
Cells for HA !
Monitored and Restarted
Page 28
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Meet the Receptor
28
Receptor!(API)
Desired Tasks
Desired LRPs
Page 29
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Desired Task
29
{ ... ! "rootfs": "docker:///docker-org/docker-image", "env": [ {"name": "ENV_NAME_A", "value": "ENV_VALUE_A"}, {"name": "ENV_NAME_B", "value": "ENV_VALUE_B"} ], ! "cpu_weight": 57, "disk_mb": 1024, "memory_mb": 128, "privileged": true, ! "action": ACTION(s) TO RUN, ! ... }
Page 30
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Actions
• RunAction: run proc in container
• DownloadAction: fetches and extract archive
• UploadAction: POST file from container to URL
• ParallelAction: run multiple actions in parallel
• SerialAction: runs multiple actions in order
• EmitProgressAction: wraps action and logs progress
• TimeoutAction: wrap action and fail if timed out
• TryAction: wrap action and ignore errors
30
Page 31
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Desired LRP
31
{ ... "instances": 17, "rootfs": "VALID-ROOTFS", "env": [ {"name": "ENV_NAME_A", "value": "ENV_VALUE_A"}, {"name": "ENV_NAME_B", "value": "ENV_VALUE_B"} ], "cpu_weight": 57, "disk_mb": 1024, "memory_mb": 128, "privileged": true, "setup": ACTION, "action": ACTION, "monitor": ACTION, "start_timeout": N seconds, "ports": [8080, 5050], ... }
Page 32
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Meet the BBS
32
Receptor!(API)
Desired Tasks
Desired LRPs
BBSDesired !
Work
Page 33
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Let’s Have an Auction
33
Receptor!(API)
Desired Tasks
Desired LRPs
BBSDesired !
Work
Auctioneer
Rep Rep Rep
Desired Work
Page 34
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Let’s Have an Auction
34
Receptor!(API)
Desired Tasks
Desired LRPs
BBSDesired !
Work
Auctioneer
Rep Rep Rep
Collect Bids
Page 35
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Let’s Have an Auction
35
Receptor!(API)
Desired Tasks
Desired LRPs
BBSDesired !
Work
Auctioneer
Rep Rep Rep
Score and Choose Winner
Page 36
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Inside the Cell
36
Rep!!Tasks
& LRPs
Run !
Action
Executor!!Actions
Garden!!Containers (Platform
Independent)
Garden!Linux!!
Containers (Linux)Run
!Container
Run !
Linux Container
Page 37
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Specificity Gradient
37
Rep!!Tasks
& LRPs
Executor!!Actions
Garden!!Containers (Platform
Independent)
Garden!Linux!!
Containers (Linux)
Page 38
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
REPresenting the Actual Work
38
Receptor!(API)
Desired Tasks
Desired LRPs
BBSDesired !
Work
Auctioneer
Rep Rep Rep
Actual Work
Page 39
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
What is the Truth?
39
BBSDesired State
Actual State
Events EventsPolling Polling
ConvergerRepSTOP THAT! Auctioneer
START THAT!
Page 40
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
With a BOSH under the hood…
40
http://bosh.io
Page 41
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
What problems does it solve?
• for a large distributed system
• deployment
• configuration changes
• updates/upgrades - minimal
downtime
• health checks and remediation
• scale out/scale in
• across multiple IaaS
41
Page 42
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
Deploying Cloud Foundry is HARD…
42
Page 43
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
ENTER THE LATTICE
43
http://lattice.cf
Page 44
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/ 44
THIS IS LATTICE
Page 45
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
How do I get a Lattice?
45
A Single VM Cluster using Vagrant
vagrant up
A Multi-VM Cluster using Terraform on:
• AWS • Google • DigitalOcean • OpenStack
terraform apply
Page 47
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/ 47
Page 48
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
We need a catalyst…
48
Page 51
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/
• Multi-tenancy with resource quotas
• Role-based access control
• Application security groups
• Highly-available components
• Zero-downtime, rolling upgrades
• Backing data service orchestration
51
• Single-tenant
• Everyone is “cluster root”
• Wide-open networking
• Not all components HA
• Red-Black upgrades
• No data services
vs.
Page 52
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/ 52
David Wadden Lattice Product Manager
Page 53
Unless otherwise indicated, these s l ides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creat ive Commons Attr ibut ion-NonCommercial l icense: ht tp: / /creat ivecommons.org/ l icenses/by-nc/3.0/ 53
Matt Stine (@mstine / [email protected] ) !
Developer Experience with Spring Cloud (Tuesday 12:45 PM - Salon E-H) Spring XD Today and Tomorrow (Tuesday 12:45 PM - Salon N-P)
Message-Driven Microservices in the Cloud (Tuesday 4:30 PM - Salon E-H) Cloud Native Data Flow Orchestration (Wednesday 8 AM - Salon N-P)
Learn More. Stay Connected.
@springcentral Spring.io/video