cloud foundry diego: modular and extensible substructure for microservices

59
CLOUD FOUNDRY DIEGO MODULAR AND EXTENSIBLE SUBSTRUCTURE FOR MICROSERVICES 1

Upload: matt-stine

Post on 16-Jul-2015

1.920 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

CLOUD FOUNDRY DIEGOMODULAR AND EXTENSIBLE SUBSTRUCTURE FOR MICROSERVICES

1

Page 2: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

MEMatt Stine @mstine

Principal Software EngineerPivotal

[email protected]

2

Page 3: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

I WROTE A LITTLE CLOUD BOOK...

FREE - Compliments of Pivotal

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

3

Page 4: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

MICROSERVICES?4

Page 5: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

Loosely coupled service oriented architecture with bounded

contexts...— Adrian Cockcroft

5

Page 6: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

YOU MUST BE THIS TALL TO USE

MICROSERVICES▸ RAPID PROVISIONING▸ BASIC MONITORING

▸ RAPID APPLICATION DEPLOYMENT▸ DEVOPS CULTURE

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

6

Page 7: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

A SYMBIOTIC RELATIONSHIP

7

Page 8: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

PLATFORM FEATURES▸ Environment Provisioning▸ On-Demand Scaling▸ Failover/Resilience▸ Routing/Load Balancing

▸ Data Service Operations (BOSH)▸ Monitoring

8

Page 9: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

But we need MOAR features...

9

Page 10: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

HARDTO ADD NEW FEATURES

HARDTO MAINTAIN EXISTING FEATURES

10

Page 11: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

WHY IS IT HARD?

From https://www.youtube.com/watch?v=1OkmVTFhfLY11

Page 12: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

ENTER THEREWRITE

12

Page 13: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

WHAT?

From https://www.youtube.com/watch?v=1OkmVTFhfLY13

Page 14: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

THE RESULT:

14

Page 15: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

THIS IS DIEGO

15

Page 16: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

MEET THE RECEPTOR

16

Page 17: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

TASKSONE-OFF WORK

LRPSLONG-RUNNING PROCESSES

17

Page 18: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

DESIRED TASK{ ...

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

...}

18

Page 19: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

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

19

Page 20: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

MOAR ACTIONS▸ EmitProgressAction: wraps action and logs progress▸ TimeoutAction: wrap action and fail if timed out▸ TryAction: wrap action and ignore errors

20

Page 21: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

DESIRED LRP{ ...

"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],

...}

21

Page 22: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

MEET THE BBS

22

Page 23: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

LET'S HAVE AN AUCTION

23

Page 24: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

LET'S HAVE AN AUCTION

24

Page 25: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

LET'S HAVE AN AUCTION

25

Page 26: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

INSIDE THE CELL

26

Page 27: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

INSIDE THE CELL

27

Page 28: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

INSIDE THE CELL

28

Page 29: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

INSIDE THE CELL

29

Page 30: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

SPECIFICITY GRADIENT

30

Page 31: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

REP RESENTING THE ACTUAL WORK

31

Page 32: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

WHAT IS THE TRUTH?

32

Page 33: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

WHAT IS THE TRUTH?

33

Page 34: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

WHAT IS THE TRUTH?

34

Page 35: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

CONVERGENCE

35

Page 36: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

PLAY WITH DIEGO?

36

Page 37: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

DEPLOYING CLOUD FOUNDRY IS HARD

37

Page 38: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

https://lattice.cf38

Page 39: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

THIS IS LATTICE

39

Page 40: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

LATTICE + DIEGO▸ Adds CF GoRouter (dynamic HTTP routing)▸ Adds Doppler (log/metrics aggregation)

▸ LOCAL: vagrant up▸ CLOUD: terraform apply (AWS, Google, DigitalOcean)

40

Page 41: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

DEMO41

Page 42: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

WHATELSE?

42

Page 43: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

MICROSERVICES43

Page 44: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

NO MICROSERVICEIS AN ISLAND

44

Page 45: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

CHALLENGES OF DISTRIBUTED SYSTEMS▸ Configuration Management

▸ Service Registration & Discovery▸ Routing & Load Balancing

▸ Fault Tolerance (Circuit Breakers!)▸ Monitoring

▸ Concurrent API Aggregation & Transformation45

Page 46: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

46

Page 47: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

SPRING CLOUDDISTRIBUTED SYSTEM PATTERNS FTW!

47

Page 48: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

SPRING CLOUD LATTICE▸ https://github.com/spring-cloud/spring-cloud-

lattice▸ https://spring.io/guides/gs/spring-cloud-and-

lattice

48

Page 49: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

EUREKA + RIBBON

49

Page 50: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

LATTICE + RIBBON

50

Page 51: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

DEMO51

Page 52: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

DATAMICROSERVICES?

52

Page 53: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

SPRING XD

http://projects.spring.io/spring-xd53

Page 54: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

SPRING XD DISTRIBUTED RUNTIME

54

Page 55: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

SPRING XD SPI MODEL

55

Page 56: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

SPRING XD + LATTICE

56

Page 57: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

DEMO57

Page 58: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

LEARN MORE!▸ Lattice: http://lattice.cf

▸ Diego Design Notes: https://github.com/cloudfoundry-incubator/diego-design-notes

58

Page 59: Cloud Foundry Diego: Modular and Extensible Substructure for Microservices

THANKYOU!

59