Slide 1

Slide 1 text

Kubernetes for Developers Hossam Barakat Lead Consultant at Telstra Purple @hossambarakat_

Slide 2

Slide 2 text

@hossambarakat_ • What is Kubernetes? • Why Kubernetes? • Kubernetes Architecture • Deploy Web App with DB on Kubernetes Agenda

Slide 3

Slide 3 text

@hossambarakat_ Containers Hardware Host Operating System Application Application Application Container Dependencies Application Host Operating System Hardware Container Engine Container Container Container Container Hardware Host Operating System Virtual Machine Guest OS Application Virtual Machine Guest OS Application Hypervisor

Slide 4

Slide 4 text

@hossambarakat_ The application is deployed to production

Slide 5

Slide 5 text

@hossambarakat_ Then the application went viral

Slide 6

Slide 6 text

@hossambarakat_ Containers bring scalability challenges!

Slide 7

Slide 7 text

@hossambarakat_ Container orchestration platforms to rescue

Slide 8

Slide 8 text

@hossambarakat_ • Service discovery • Scaling • Health monitoring • Failover • Networking • Scheduling • Coordinated app upgrades Container Orchestration

Slide 9

Slide 9 text

@hossambarakat_ Kubernetes

Slide 10

Slide 10 text

@hossambarakat_ Kubernetes Architecture Master Worker Worker Client Worker Cluster

Slide 11

Slide 11 text

@hossambarakat_ Kubernetes Architecture Master API Server Scheduler Worker Kubelet Container Runtime UI (Dashboard) CLI (Kubectl) Other Client(s) Container Container Cluster

Slide 12

Slide 12 text

@hossambarakat_ ASP .NET App On Kubernetes ASP.NET Application

Slide 13

Slide 13 text

@hossambarakat_ ASP .NET App On Kubernetes ASP.NET Application ASP.NET Application ASP.NET Application

Slide 14

Slide 14 text

@hossambarakat_ Pods

Slide 15

Slide 15 text

@hossambarakat_ Pods Pod

Slide 16

Slide 16 text

@hossambarakat_ Pods Scaling Pod Pod

Slide 17

Slide 17 text

@hossambarakat_ Pod kind: Pod apiVersion: v1 metadata: name: tasks-app spec: containers: - name: tasks-app image: hossambarakat/tasklist ports: - containerPort: 80 $ Kubectl apply -f pod.yaml

Slide 18

Slide 18 text

@hossambarakat_ But wait… what happens if the pod dies?

Slide 19

Slide 19 text

@hossambarakat_ ReplicaSets Pod ReplicaSet Pod

Slide 20

Slide 20 text

@hossambarakat_

Slide 21

Slide 21 text

@hossambarakat_ Deployment ReplicaSet Deployment Pod Pod

Slide 22

Slide 22 text

@hossambarakat_ Deployment Rollout Deployment ReplicaSet V2 Pod Pod ReplicaSet V1 Pod Pod

Slide 23

Slide 23 text

@hossambarakat_

Slide 24

Slide 24 text

@hossambarakat_ Connecting to Pods 10.0.0.1 DB Pod A 10.0.0.2 DB Pod B ASP.NET Pod

Slide 25

Slide 25 text

@hossambarakat_ Service 10.0.0.2 Pod B 10.0.0.3 Pod C IP: 10.0.0.30 DNS: myservice Service 10.0.0.1 Pod A

Slide 26

Slide 26 text

@hossambarakat_ Service IP: 10.0.0.30 DNS: tasks-app-svc Service IP: 10.0.0.90 DNS: mssql-service Service 10.0.0.1 Pod 10.0.0.1 Pod 10.0.0.1 Pod

Slide 27

Slide 27 text

@hossambarakat_

Slide 28

Slide 28 text

@hossambarakat_ Kubernetes in the cloud

Slide 29

Slide 29 text

Azure AKS $ az aks create -g myResourceGroup -n myCluster --generate-ssh-keys $ az aks upgrade --kubernetes-version 1.12.6 --name myCluster --resource-group myResourceGroup $ az aks scale -g myResourceGroup -n myCluster --node-count 6

Slide 30

Slide 30 text

@hossambarakat_ • Scale agent nodes based on pending pods and nodes utilization • Scans the cluster periodically to check for pending pods or empty nodes and increases the size if possible AKS Cluster Autoscaler

Slide 31

Slide 31 text

@hossambarakat_ • Kubernetes Architecture • Deploy application using different workloads • Kubernetes in the cloud Summary

Slide 32

Slide 32 text

@hossambarakat_ • https://github.com/hossambarakat/TaskList • Introduction to Kubernetes (edX) • Learn Kubernetes using Interactive Hands-on Scenarios (Katacoda) • https://kubernetes.io/docs/ Resources

Slide 33

Slide 33 text

@hossambarakat_ Questions? #2019addo-cloudnative

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Thanks Hossam Barakat @hossambarakat_