Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides...

52
| CALLISTAENTERPRISE.SE KUBERNETES BJÖRN BESKOW 2016-01-27

Transcript of Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides...

Page 1: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

| CALLISTAENTERPRISE.SE

KUBERNETES

BJÖRN BESKOW

2016-01-27

Page 2: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

Many small, moving parts

BACKGROUND

2

Page 3: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

3

Page 4: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

Software, Hardware & Networks

BACKGROUND

4

Page 5: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

Failures are inevitable

BACKGROUND

5

Page 6: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

6

Page 7: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

Ephemeral

BACKGROUND

7

Page 8: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

8

Page 9: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

9

Page 10: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

10

Page 11: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

11 Source: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43438.pdf

Page 12: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

Treat all hardware nodes as one giant logical

machine

GOALS

12

Page 13: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

Focus on your "applications"

GOALS

13

Page 14: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

Manage your applications through "Wishful Thinking": Declare how it ought to be

GOALS

14

Page 15: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

15

Page 16: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

16 Source: http://kubernetes.io/

Page 17: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

DEMO SETUP

17

Page 18: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

18

DEMO SETUP

Page 19: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

19

DEMO SETUP

Page 20: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

20

Source: https://github.com/rimusz/coreos-osx-kubernetes-cluster

Page 21: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

21

Page 22: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

Kubectl CLI CORE CONCEPTS

22

Page 23: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

• Node CORE CONCEPTS

23

Page 24: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

24

Page 25: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

• Node • Container

CORE CONCEPTS

25

Page 26: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

• Node • Container • Pod

CORE CONCEPTS

26

Page 27: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

apiVersion: v1 kind: Pod metadata: name: quotes spec: containers: - name: quotes image: docker:5000/quotes:1 ports: - containerPort: 9090 hostPort: 9090

QUOTES-POD.YAML

27

Page 28: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

28

Page 29: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

• Node • Container • Pod • Replication Controller

CORE CONCEPTS

29

replicas: 2

Upcoming feature: auto-scaling based on load: see https://github.com/kubernetes/kubernetes/blob/master/docs/design/horizontal-pod-autoscaler.md

Page 30: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

apiVersion: v1 kind: ReplicationController metadata: name: quotes spec: replicas: 2 ... template: spec: containers: - name: quotes image: docker:5000/quotes:1

QUOTES-CONTROLLER.YAML

30

replicas: 2

Page 31: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

31

Page 32: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

• Node • Container • Pod • Replication Controller • Labels

CORE CONCEPTS

32

app:quotes

app:quotes

Page 33: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

• Node • Container • Pod • Replication Controller • Labels

CORE CONCEPTS

33

app:quotes version: 1 tier: backend

app:quotes version: 2 tier: backend

app:portal version: 1 tier: frontend

app:portal version: 2 tier: frontend

Page 34: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

• Node • Container • Pod • Replication Controller • Labels

CORE CONCEPTS

34

app:quotes version:1 tier:backend

app:quotes version:2 tier:backend

app:portal version:1 tier:frontend

app:portal version:2 tier:frontend

selector: app:quotes

Page 35: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

• Node • Container • Pod • Replication Controller • Labels

CORE CONCEPTS

35

app:quotes version:1 tier:backend

app:quotes version:2 tier:backend

app:portal version:1 tier:frontend

app:portal version:2 tier:frontend

selector: version:1

Page 36: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

• Node • Container • Pod • Replication Controller • Labels

CORE CONCEPTS

36

app:quotes version:1 tier:backend

app:quotes version:2 tier:backend

app:portal version:1 tier:frontend

app:portal version:2 tier:frontend

selector: app:quotes version:1

Page 37: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

• Node • Container • Pod • Replication Controller • Labels

CORE CONCEPTS

37

app:quotes

app:quotes

replicas: 2 selector: app:quotes

Page 38: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

apiVersion: v1 kind: ReplicationController metadata: name: quotes labels: app: quotes spec: replicas: 2 selector: app: quotes version: 1 template: ...

QUOTES-CONTROLLER.YAML

38

replicas: 2 selector: app:quotes version:1

Page 39: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

... template: metadata: labels: app: quotes version: 1 spec: containers: - name: quotes image: docker:5000/quotes:1 ports: - containerPort: 9090

QUOTES-CONTROLLER.YAML

39

app:quotes version:1

app:quotes version:1

Page 40: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

• Node • Container • Pod • Replication Controller • Label • Liveness

CORE CONCEPTS

40

Page 41: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

... livenessProbe: httpGet: path: /health port: 9090 initialDelaySeconds: 10 timeoutSeconds: 1

QUOTES-CONTROLLER.YAML

41

Page 42: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

42

Page 43: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

• Node • Container • Pod • Replication Controller • Label • Liveness •  Service

CORE CONCEPTS

43

app:quotes

app:quotes

app:portal

Page 44: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

• Node • Container • Pod • Replication Controller • Label • Liveness •  Service

CORE CONCEPTS

44

app:quotes

app:quotes

app:portal

name:quotes-service selector: app:quotes

Page 45: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

apiVersion: v1 kind: Service metadata: name: quotes-service labels: app: quotes tier: frontend spec: ports: - port: 8080 targetPort: 8080 selector: app: quotes

QUOTES-SERVICE.YAML

45

app:quotes

app:quotes

name:quotes-service selector: app:quotes

Page 46: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

46

Page 47: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

ADVANCED CONCEPTS: ROLLING UPGRADE

47

app:quotes version:1

app:portal

name:quotes-service selector: app:quotes

app:quotes version:1

Page 48: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

ADVANCED CONCEPTS: ROLLING UPGRADE

48

app:quotes version:2

app:portal app:quotes version:2

name:quotes-service selector: app:quotes

Page 49: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

ADVANCED CONCEPTS: ROLLING UPGRADE

49

app:quotes version:2

app:portal app:quotes version:2

name:quotes-service selector: app:quotes app:quotes

version:1

app:quotes version:1

Page 50: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

50

Page 51: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

•  Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical components from each other and from the

infrastructure •  Kubernetes is just one of many alternatives (Mesos, Helios, Docker

Swarm, …), but its Google background makes it one of the most interesting. Stay tuned!

CONCLUSIONS

51

Page 52: Kubernetes - callistaenterprise.se · • Container Orchestration software like Kubernetes provides highly valuable capabilities for Microservice architectures: - Decoupling logical

52

TIME FOR QUESTIONS?