$30 off During Our Annual Pro Sale. View Details »

Kubernetes for Developers - All Day DevOps

Kubernetes for Developers - All Day DevOps

Hossam Barakat

November 06, 2019
Tweet

More Decks by Hossam Barakat

Other Decks in Programming

Transcript

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

    View Slide

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

    View Slide

  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

    View Slide

  4. @hossambarakat_
    The application is deployed to
    production

    View Slide

  5. @hossambarakat_
    Then the application went viral

    View Slide

  6. @hossambarakat_
    Containers bring scalability challenges!

    View Slide

  7. @hossambarakat_
    Container orchestration platforms to rescue

    View Slide

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

    View Slide

  9. @hossambarakat_
    Kubernetes

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  14. @hossambarakat_
    Pods

    View Slide

  15. @hossambarakat_
    Pods
    Pod

    View Slide

  16. @hossambarakat_
    Pods Scaling
    Pod
    Pod

    View Slide

  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

    View Slide

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

    View Slide

  19. @hossambarakat_
    ReplicaSets
    Pod
    ReplicaSet
    Pod

    View Slide

  20. @hossambarakat_

    View Slide

  21. @hossambarakat_
    Deployment
    ReplicaSet
    Deployment
    Pod Pod

    View Slide

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

    View Slide

  23. @hossambarakat_

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  27. @hossambarakat_

    View Slide

  28. @hossambarakat_
    Kubernetes in the cloud

    View Slide

  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

    View Slide

  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

    View Slide

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

    View Slide

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

    View Slide

  33. @hossambarakat_
    Questions?
    #2019addo-cloudnative

    View Slide

  34. View Slide

  35. Thanks
    Hossam Barakat
    @hossambarakat_

    View Slide