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

Kubernetes 101 Google IO Talk

Kubernetes 101 Google IO Talk

What is Kubernetes 101?
How do I manage application at scale? That’s a common question facing developers today and this code lab helps to make sense of the ever changing scalable app landscape. We'll use Docker and Kubernetes to deploy, scale, and manage a microservices based application in this talk.

Carter Morgan

August 04, 2016
Tweet

More Decks by Carter Morgan

Other Decks in Technology

Transcript

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

    View full-size slide

  2. Photo © Annette Shaff via Canva.com
    #K8story

    View full-size slide

  3. monolith
    nginx
    hello
    nginx
    Microservices
    Monolith
    auth

    View full-size slide

  4. Use Containers
    Photo © ptnimages via Canva.com
    Best
    Practice

    View full-size slide

  5. Container Demo

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  13. Kubernetes Quick Demo

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  23. monolith
    nginx
    hello
    nginx
    Microservices
    Monolith
    auth

    View full-size slide

  24. Kubernetes Demo

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  27. Rolling Update
    Node 1
    Pod
    hello
    Pod
    hello
    Node
    Pod
    hello
    Node
    Pod
    hello
    Node
    Pod
    hello
    Service

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  34. Rollout
    Node 1
    Pod
    hello
    Pod
    hello
    Node
    Pod
    hello
    Node
    Node
    Service
    Pod
    goodbye
    Pod
    goodbye

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  39. Rollout Demo

    View full-size slide

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

    View full-size slide

  41. DevOps Engineer Nanodegree Program
    Scalable Microservices with Kubernetes
    course

    View full-size slide

  42. Scalable Microservices with Kubernetes

    View full-size slide

  43. #K8story
    Carter Morgan
    @_askcarter

    View full-size slide