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

Post on 09-Sep-2019

6 views 0 download

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

| CALLISTAENTERPRISE.SE

KUBERNETES

BJÖRN BESKOW

2016-01-27

Many small, moving parts

BACKGROUND

2

3

Software, Hardware & Networks

BACKGROUND

4

Failures are inevitable

BACKGROUND

5

6

Ephemeral

BACKGROUND

7

8

9

10

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

Treat all hardware nodes as one giant logical

machine

GOALS

12

Focus on your "applications"

GOALS

13

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

GOALS

14

15

16 Source: http://kubernetes.io/

DEMO SETUP

17

18

DEMO SETUP

19

DEMO SETUP

20

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

21

Kubectl CLI CORE CONCEPTS

22

• Node CORE CONCEPTS

23

24

• Node • Container

CORE CONCEPTS

25

• Node • Container • Pod

CORE CONCEPTS

26

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

28

• 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

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

31

• Node • Container • Pod • Replication Controller • Labels

CORE CONCEPTS

32

app:quotes

app:quotes

• 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

• 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

• 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

• 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

• Node • Container • Pod • Replication Controller • Labels

CORE CONCEPTS

37

app:quotes

app:quotes

replicas: 2 selector: app:quotes

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

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

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

CORE CONCEPTS

40

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

QUOTES-CONTROLLER.YAML

41

42

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

CORE CONCEPTS

43

app:quotes

app:quotes

app:portal

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

CORE CONCEPTS

44

app:quotes

app:quotes

app:portal

name:quotes-service selector: app:quotes

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

46

ADVANCED CONCEPTS: ROLLING UPGRADE

47

app:quotes version:1

app:portal

name:quotes-service selector: app:quotes

app:quotes version:1

ADVANCED CONCEPTS: ROLLING UPGRADE

48

app:quotes version:2

app:portal app:quotes version:2

name:quotes-service selector: app:quotes

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

50

•  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

52

TIME FOR QUESTIONS?