Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kubernetes for Developers - All Day DevOps

Kubernetes for Developers - All Day DevOps

Hossam Barakat

November 06, 2019

More Decks by Hossam Barakat

Other Decks in Programming


  1. Kubernetes for Developers Hossam Barakat Lead Consultant at Telstra Purple

  2. @hossambarakat_ • What is Kubernetes? • Why Kubernetes? • Kubernetes

    Architecture • Deploy Web App with DB on Kubernetes Agenda
  3. @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
  4. @hossambarakat_ The application is deployed to production

  5. @hossambarakat_ Then the application went viral

  6. @hossambarakat_ Containers bring scalability challenges!

  7. @hossambarakat_ Container orchestration platforms to rescue

  8. @hossambarakat_ • Service discovery • Scaling • Health monitoring •

    Failover • Networking • Scheduling • Coordinated app upgrades Container Orchestration
  9. @hossambarakat_ Kubernetes

  10. @hossambarakat_ Kubernetes Architecture Master Worker Worker Client Worker Cluster

  11. @hossambarakat_ Kubernetes Architecture Master API Server Scheduler Worker Kubelet Container

    Runtime UI (Dashboard) CLI (Kubectl) Other Client(s) Container Container Cluster
  12. @hossambarakat_ ASP .NET App On Kubernetes ASP.NET Application

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

    ASP.NET Application
  14. @hossambarakat_ Pods

  15. @hossambarakat_ Pods Pod

  16. @hossambarakat_ Pods Scaling Pod Pod

  17. @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
  18. @hossambarakat_ But wait… what happens if the pod dies?

  19. @hossambarakat_ ReplicaSets Pod ReplicaSet Pod

  20. @hossambarakat_

  21. @hossambarakat_ Deployment ReplicaSet Deployment Pod Pod

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

    Pod Pod
  23. @hossambarakat_

  24. @hossambarakat_ Connecting to Pods DB Pod A DB

    Pod B ASP.NET Pod
  25. @hossambarakat_ Service Pod B Pod C IP:

    DNS: myservice Service Pod A
  26. @hossambarakat_ Service IP: DNS: tasks-app-svc Service IP: DNS:

    mssql-service Service Pod Pod Pod
  27. @hossambarakat_

  28. @hossambarakat_ Kubernetes in the cloud

  29. 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
  30. @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
  31. @hossambarakat_ • Kubernetes Architecture • Deploy application using different workloads

    • Kubernetes in the cloud Summary
  32. @hossambarakat_ • https://github.com/hossambarakat/TaskList • Introduction to Kubernetes (edX) • Learn

    Kubernetes using Interactive Hands-on Scenarios (Katacoda) • https://kubernetes.io/docs/ Resources
  33. @hossambarakat_ Questions? #2019addo-cloudnative

  34. None
  35. Thanks Hossam Barakat @hossambarakat_