Upload
matt-stine
View
1.693
Download
1
Embed Size (px)
Citation preview
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
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!
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.
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.
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.
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.
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.
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
HA Container Execution Nodes
HA Container Scheduler
and Health Monitor
HA Consistent Shared State
Diego
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
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.
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
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
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
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, ! ... }
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
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], ... }
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
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
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
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
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
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)
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
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!
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
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
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
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
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
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
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
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
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.
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
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