Slide 1

Slide 1 text

Best Practices for Orchestrating the Cloud with Kubernetes Carter Morgan @_askcarter

Slide 2

Slide 2 text

Photo © Annette Shaff via Canva.com #K8story

Slide 3

Slide 3 text

monolith nginx hello nginx Microservices Monolith auth

Slide 4

Slide 4 text

Use Containers Photo © ptnimages via Canva.com Best Practice

Slide 5

Slide 5 text

Container Demo

Slide 6

Slide 6 text

But that’s just one machine Discovery Scaling Security Monitoring Configuration Scheduling Health

Slide 7

Slide 7 text

Automate and Monitor Photo © 3Dalia via Canva.com Best Practice

Slide 8

Slide 8 text

Avoid Vendor Lock-in Photo © Michele Piacquadio via Canva.com Best Practice

Slide 9

Slide 9 text

Kubernetes Open Source Container Automation Framework • Open API • Based on Google’s experiences

Slide 10

Slide 10 text

Velocity 1.0 1.1 1.2 v1.2: - 5k commits - +50% unique contributors Source: http://github.com/kubernetes/kubernetes

Slide 11

Slide 11 text

1.2 • Deployments • DaemonSets • New UI • Simplified Deployments • Automated Cluster Management • Improved Scale 1.3 • Legacy application support • Cluster Federation • More nodes • In-cluster IAM • Scheduled jobs • Cluster autoscaling • Public cloud dashboard

Slide 12

Slide 12 text

Community Companies Contributing Companies Using 1200+ external projects based on k8s 800+ unique contributors Top 0.01% of all Github projects

Slide 13

Slide 13 text

Kubernetes Quick Demo

Slide 14

Slide 14 text

Pods Logical Application • One or more containers and volumes • Shared namespaces • One IP per pod Pod nginx monolith NFS iSCSI GCE 10.1.0.100

Slide 15

Slide 15 text

Labels Arbitrary metadata attached to any API object • Queryable by Selectors • How Kubernetes does grouping Pod nginx monolith Pod nginx monolith labels: version: v1 track: stable labels: version: v1 track: test

Slide 16

Slide 16 text

Labels selector: version=v1 Pod nginx monolith Pod nginx monolith labels: version: v1 track: stable labels: version: v1 track: test

Slide 17

Slide 17 text

Labels selector: track=stable Pod nginx monolith Pod nginx monolith labels: version: v1 track: stable labels: version: v1 track: test

Slide 18

Slide 18 text

Services Persistent IPs for Pods • Uses Labels to Target Pods • Internal or External IPs Pod nginx monolith Pod nginx monolith Service 10.8.244.100 10.1.0.2 10.1.0.1

Slide 19

Slide 19 text

Deployments Drive current state towards desired state Node 1 Pod app: hello replicas: 1 hello Node 2

Slide 20

Slide 20 text

Deployments Drive current state towards desired state Node 1 Pod app: hello replicas: 2 hello Node 2 Pod hello

Slide 21

Slide 21 text

Deployments Drive current state towards desired state Node 1 Pod app: hello replicas: 2 hello Node 2

Slide 22

Slide 22 text

Deployments Drive current state towards desired state Node 1 Pod app: hello replicas: 2 hello Node 2 Pod hello

Slide 23

Slide 23 text

monolith nginx hello nginx Microservices Monolith auth

Slide 24

Slide 24 text

Kubernetes Demo

Slide 25

Slide 25 text

What about code updates? Photo © hjalmeida via Canva.com

Slide 26

Slide 26 text

Deploy with care Photo © Green Jo via Canva.com Best Practice

Slide 27

Slide 27 text

Rolling Update Node 1 Pod hello Pod hello Node Pod hello Node Pod hello Node Pod hello Service

Slide 28

Slide 28 text

Rolling Update Node 1 Pod hello Pod hello Node Pod hello Node Pod hello Node Pod hello Service Pod goodbye

Slide 29

Slide 29 text

Rolling Update Node 1 Pod hello Pod hello Node Pod hello Node Pod hello Node Pod hello Service Pod goodbye

Slide 30

Slide 30 text

Rolling Update Node 1 Pod hello Pod hello Node Pod hello Node Pod hello Node Pod hello Service Pod goodbye

Slide 31

Slide 31 text

Rolling Update Node 1 Pod hello Pod hello Node Pod hello Node Node Pod hello Service Pod goodbye Pod goodbye

Slide 32

Slide 32 text

Rolling Update Node 1 Pod hello Pod hello Node Pod hello Node Node Pod hello Service Pod goodbye Pod goodbye

Slide 33

Slide 33 text

Rolling Update Node 1 Pod hello Pod hello Node Pod hello Node Node Pod hello Service Pod goodbye Pod goodbye

Slide 34

Slide 34 text

Rollout Node 1 Pod hello Pod hello Node Pod hello Node Node Service Pod goodbye Pod goodbye

Slide 35

Slide 35 text

Rolling Update Node 1 Pod hello Pod hello Node Pod hello Node Node Service Pod goodbye Pod goodbye Pod goodbye

Slide 36

Slide 36 text

Rolling Update Node 1 Pod hello Pod hello Node Pod hello Node Node Service Pod goodbye Pod goodbye Pod goodbye

Slide 37

Slide 37 text

Rolling Update Node 1 Pod hello Pod hello Node Pod hello Node Node Service Pod goodbye Pod goodbye Pod goodbye

Slide 38

Slide 38 text

Rolling Update Node 1 Pod hello Pod hello Node Node Node Service Pod goodbye Pod goodbye Pod goodbye

Slide 39

Slide 39 text

Rollout Demo

Slide 40

Slide 40 text

Best Practices Recap The App: Use containers The Infra: Automate and Monitor The Infra: Avoid Lock-in The Wild: Deploy with Care

Slide 41

Slide 41 text

DevOps Engineer Nanodegree Program Scalable Microservices with Kubernetes course

Slide 42

Slide 42 text

Scalable Microservices with Kubernetes

Slide 43

Slide 43 text

#K8story Carter Morgan @_askcarter