deploying microservices to cloud foundry
TRANSCRIPT
![Page 1: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/1.jpg)
DEPLOYING MICROSERVICES TO
1
![Page 2: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/2.jpg)
MEMatt Stine @mstine
Principal Software EngineerPivotal
2
![Page 3: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/3.jpg)
I WROTE A LITTLE CLOUD BOOK...
FREE - Compliments of Pivotal
http://bit.ly/cloud-native-book
ATTACK THE PIVOTAL BOOTH TO GET A PRINT
COPY!3
![Page 4: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/4.jpg)
Now that you have Cloud Foundry, what are you going to do with it?
4
![Page 5: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/5.jpg)
IF YOU'RE SMART, START WITH A
MONOLITH.5
![Page 6: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/6.jpg)
MAKE IT 12 FACTOR6
![Page 7: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/7.jpg)
EVENTUALLY THINGS GET BIGGER...
7
![Page 8: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/8.jpg)
...AND IT BECOMES TIME TO DECOMPOSE.8
![Page 9: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/9.jpg)
MICROSERVICES?9
![Page 10: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/10.jpg)
Loosely coupled service oriented architecture with bounded contexts...
— Adrian Cockcroft
10
![Page 11: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/11.jpg)
YOU MUST BE THIS TALL TO USE MICROSERVICES
▸ RAPID PROVISIONING▸ BASIC MONITORING
▸ RAPID APPLICATION DEPLOYMENT▸ DEVOPS CULTURE
http://martinfowler.com/bliki/MicroservicePrerequisites.html
11
![Page 12: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/12.jpg)
A SYMBIOTIC RELATIONSHIP
12
![Page 13: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/13.jpg)
PLATFORM FEATURES▸ Environment Provisioning▸ On-Demand Scaling▸ Failover/Resilience▸ Routing/Load Balancing
▸ Data Service Operations (BOSH)13
![Page 14: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/14.jpg)
NO MICROSERVICEIS AN ISLAND
14
![Page 15: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/15.jpg)
SOME CHALLENGES OF DISTRIBUTED SYSTEMS▸ Configuration Management
▸ Service Registration & Discovery▸ Routing & Load Balancing▸ Fault Tolerance▸ Monitoring
15
![Page 16: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/16.jpg)
We need a representation of the composite system!
16
![Page 17: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/17.jpg)
THE BIG A APP17
![Page 18: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/18.jpg)
---memory: 512Minstances: 1no-route: trueservices: - cloudamqp-autoscaleapplications:- name: worker-process path: worker-process/build/libs/worker-process.jar- name: producer-process path: producer/build/libs/producer.jar- name: autoscaler-process path: autoscaler/build/libs/autoscaler.jar- name: autoscale-monitor no-route: false host: autoscale-monitor-${random-word} path: monitor/build/libs/monitor.jar
18
![Page 19: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/19.jpg)
STATICVS.
DYNAMIC19
![Page 20: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/20.jpg)
Like BOSH, but for microservices?
20
![Page 21: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/21.jpg)
DECENTRALIZEDAUTONOMOUSCAPABILITY
TEAMS / SERVICES21
![Page 22: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/22.jpg)
You write it, you run it!
22
![Page 23: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/23.jpg)
23
![Page 24: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/24.jpg)
SPRING CLOUDDISTRIBUTED SYSTEM PATTERNS FTW!
24
![Page 25: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/25.jpg)
APP/SERVICELEVEL
PATTERNS25
![Page 26: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/26.jpg)
DEPLOYING/RUNNING APPS
VS.COMPOSING FAULT TOLERANT SYSTEMS
26
![Page 27: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/27.jpg)
SPRING CLOUD + NETFLIX OSS▸ Config Server / Cloud Bus▸ Eureka (Service Registry)▸ Ribbon (Load Balancer)▸ Hystrix (Circuit Breakers)▸ Zuul (Intelligent Routing)
27
![Page 28: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/28.jpg)
WORKS ON LATTICE TOO!
https://lattice.cf28
![Page 29: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/29.jpg)
CONFIG SERVER
29
![Page 30: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/30.jpg)
CONFIG SERVER + CLOUD BUS
30
![Page 31: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/31.jpg)
DEMO31
![Page 32: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/32.jpg)
EUREKA (SERVICE REGISTRY)
32
![Page 33: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/33.jpg)
DEMO33
![Page 34: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/34.jpg)
BEFORE CF_RELEASE V204
34
![Page 35: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/35.jpg)
CF_RELEASE V195"CF_INSTANCE_INDEX"=>"0","CF_INSTANCE_IP"=>"1.2.3.4","CF_INSTANCE_PORT"=>"5678","CF_INSTANCE_ADDR"=>"1.2.3.4:5678","CF_INSTANCE_PORTS"=>[{external:80,internal:5678}]
35
![Page 36: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/36.jpg)
CF_RELEASE V204properties: dea_next: allow_host_access: true
36
![Page 37: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/37.jpg)
AFTER CF_RELEASE V204
37
![Page 38: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/38.jpg)
DEMO38
![Page 39: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/39.jpg)
HYSTRIX (CIRCUIT BREAKER)
39
![Page 40: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/40.jpg)
DEMO40
![Page 41: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/41.jpg)
ZUUL (INTELLIGENT ROUTING)
41
![Page 42: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/42.jpg)
DEMO42
![Page 43: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/43.jpg)
SPRING CLOUD FUTURES▸ Alternative Stacks (Consul, Zookeeper, etcd, JRugged, ...)▸ Distributed Request Tracing/Correlation (i.e. Dapper/Zipkin)▸ Stateful Patterns (Leader Election, Locks, State Machine)
▸ Developer Workflow Improvements▸ Switches (Canaries, Feature Toggles, Surgical Routing, ...)
43
![Page 44: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/44.jpg)
LEARN MOAR▸ http://cloud.spring.io
▸ http://spring.io/blog/2015/04/06/lattice-and-spring-cloud-resilient-sub-structure-for-your-cloud-native-spring-applications
▸ http://lattice.cf▸ http://netflix.github.io
44
![Page 45: Deploying Microservices to Cloud Foundry](https://reader034.vdocument.in/reader034/viewer/2022042518/55b1174abb61eb271e8b47b1/html5/thumbnails/45.jpg)
THANK YOU▸ THIS TALK: https://github.com/mstine/2015-cfsummit-deploying-
ms-to-cf▸ DEMOS: https://github.com/mstine/intro-spring-cloud-workshop/
tree/lattice
45