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 Slide

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

    View Slide

  3. monolith
    nginx
    hello
    nginx
    Microservices
    Monolith
    auth

    View Slide

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

    View Slide

  5. Container Demo

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View 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 Slide

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

    View Slide

  13. Kubernetes Quick Demo

    View 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 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 Slide

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

    View Slide

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

    View 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 Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  23. monolith
    nginx
    hello
    nginx
    Microservices
    Monolith
    auth

    View Slide

  24. Kubernetes Demo

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  39. Rollout Demo

    View 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 Slide

  41. DevOps Engineer Nanodegree Program
    Scalable Microservices with Kubernetes
    course

    View Slide

  42. Scalable Microservices with Kubernetes

    View Slide

  43. #K8story
    Carter Morgan
    @_askcarter

    View Slide