deploying microservice architectures with spring cloud on cloud foundry

44
Deploying Microservices with Spring Cloud to 1

Upload: spring-by-pivotal

Post on 11-Apr-2017

1.676 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Deploying Microservices with Spring Cloud to

1

Page 2: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Matt Stine wrote a little cloud book...

FREE - Compliments of Pivotal

http://bit.ly/cloud-native-book

Download the PDF for free!

2

Page 3: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Why is Cloud Foundry such an ideal deployment

platform for microservices?

3

Page 4: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

If you're smart, start with a

MONOLITH.4

Page 5: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Make it 12 Factor

5

Page 6: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Eventually things get bigger...

6

Page 7: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

...and it becomes time to decompose.

7

Page 8: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Microservices?

8

Page 9: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Loosely coupled service oriented architecture with

bounded contexts...— Adrian Cockcroft

9

Page 10: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

You must be this tall to use Microservices

• RAPID PROVISIONING

• BASIC MONITORING

• RAPID APPLICATION DEPLOYMENT

• DEVOPS CULTURE

http://martinfowler.com/bliki/MicroservicePrerequisites.html

10

Page 11: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

A Symbiotic Relationship

11

Page 12: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Platform Features• Environment Provisioning

• On-Demand Scaling

• Failover/Resilience

• Routing/Load Balancing

• Data Service Operations (BOSH)

• Monitoring

12

Page 13: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

No Microserviceis an Island

13

Page 14: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Some Challenges of Distributed Systems• Configuration Management

• Service Registration & Discovery

• Routing & Load Balancing

• Fault Tolerance

• Monitoring

14

Page 15: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

We need a representation of the composite system!

15

Page 16: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

The BIG A App

16

Page 17: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

---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

17

Page 18: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Staticvs.

Dynamic18

Page 19: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Like BOSH, but for microservices?

19

Page 20: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

DecentralizedAutonomousCapability

Teams / Services20

Page 21: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

You write it, you run it!

21

Page 22: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

22

Page 23: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Spring CloudDistributed System Patterns FTW!

23

Page 24: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

App/ServiceLevel

Patterns24

Page 25: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Deploying/Running Apps

vs.Composing Fault Tolerant Systems

25

Page 26: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Spring Cloud + Netflix OSS• Config Server / Cloud Bus

• Eureka (Service Registry)

• Ribbon (Load Balancer)

• Hystrix (Circuit Breakers)

• Zuul (Intelligent Routing)

26

Page 27: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Works on Lattice too!

https://lattice.cf27

Page 28: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Config Server

28

Page 29: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Config Server + Cloud Bus

29

Page 30: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

DEMO30

Page 31: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Eureka (Service Registry)

31

Page 32: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

DEMORibbon (Load Balancer)

32

Page 33: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Before cf_release v204

33

Page 34: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

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}]

34

Page 35: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

cf_release v204properties: dea_next: allow_host_access: true

35

Page 36: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

After cf_release v204

36

Page 37: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

DEMO37

Page 38: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Hystrix (Circuit Breaker)

38

Page 39: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

DEMO39

Page 40: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

Zuul (Intelligent Routing)

40

Page 41: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

DEMO41

Page 42: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

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, ...)

• ???

42

Page 44: Deploying Microservice Architectures with Spring Cloud on Cloud Foundry

THANK YOU• THIS TALK: https://github.com/pieterhumphrey/devoxxPL

• DEMOS: https://github.com/mstine/intro-spring-cloud-workshop/tree/lattice

44