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

Managed Containers, Open Source, and Google

Joe Beda
August 21, 2014

Managed Containers, Open Source, and Google

Talking about Kubernetes at LinuxCon/CloudOpen in Chicago, August 21, 2014.

Joe Beda

August 21, 2014
Tweet

More Decks by Joe Beda

Other Decks in Programming

Transcript

  1. Managed Containers,
    Open Source, and Google
    2014 CloudOpen/LinuxCon
    Joe Beda
    Senior Staff Software Engineer
    [email protected]
    @jbeda

    View Slide

  2. Why Containers*?
    1. Packaging
    2. Efficiency and Speed
    3. Security (?)
    (*) Container = Docker flavor container

    View Slide

  3. Static application environment
    No stress deployment and update
    Repeatable portable artifact
    Develop here, run there
    Pick your cloud solely on its merits
    Loosely coupled
    = easier to build and manage
    Easier to build and manage
    Compose applications from micro-services
    Packaging

    View Slide

  4. Everything at Google runs in a container.
    • Resource isolation
    • Predictability
    • Quality of service
    • Efficient overcommit
    • Resource accounting
    Google starts over 2 billion containers per week.
    Images by Connie Zhou
    Efficiency

    View Slide

  5. Kubernetes
    κυβερνήτης: Greek for “pilot” or “helmsman of a ship”
    the open source cluster manager from Google

    View Slide

  6. Kubernetes
    Inspired by Google's systems and experience
    Manage Containers, not Machines
    Efficient: optimized packing, better scaling
    Performant: active environment tuning
    Robust: active monitoring, self healing
    Organizationally Scalable:
    • Split sys ops and app ops
    • Enable micro-services
    Modern Open Source:
    • Extensible & portable, can run anywhere
    • Apache 2.0 licensed
    • Written in Go
    • Hosted on github

    View Slide

  7. Node Container Manager
    Scheduled Containers
    Managed Base OS
    Managed Base OS
    Node Container Manager
    Scheduled Containers
    Cluster Scheduler
    Simplified Cluster Management Stack

    View Slide

  8. Managed Base OS
    kubelet
    Scheduled Containers
    Managed Base OS
    kubelet + Docker
    Scheduled Containers
    Kubernetes Master
    etcd
    Kubernetes Container Stack

    View Slide

  9. Kubernetes
    Master/Scheduler
    Kubernetes
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent

    View Slide

  10. Log Roller
    Web Server
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Kubernetes
    Master/Scheduler
    Pods

    View Slide

  11. FE
    FE
    FE
    FE
    FE
    FE
    BE
    BE
    BE BE
    BE
    BE
    BE
    BE
    BE
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Kubernetes - Master/Scheduler
    Too Many Pods

    View Slide

  12. labels:
    role: frontend
    FE
    FE
    FE
    FE
    FE
    FE
    BE
    BE
    BE BE
    BE
    BE
    BE
    BE
    BE
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Kubernetes - Master/Scheduler
    Labels

    View Slide

  13. labels:
    role: frontend
    stage: production
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Kubernetes - Master/Scheduler
    FE
    FE
    FE
    FE
    FE
    FE
    BE
    BE
    BE BE
    BE
    BE
    BE
    BE
    BE
    Labels

    View Slide

  14. Declarative Over Imperative
    Imperative:
    "for pod in pod{001..100} ; start $pod
    Declarative:
    "Run 100 copies of this pod with a target of
    <= 2 tasks down at any time"
    Pros:
    • Repeatable
    • "Set it and forget it"
    • Eventually consistent
    • Easily updatable
    Con:
    • Tracing action/reaction can be difficult.
    "I made a change, is it done?"
    Image: "Space Needle under construction, 1961" seattlemunicipalarchives CC-BY-2.0 http://www.flickr.
    com/photos/seattlemunicipalarchives/6847114249

    View Slide

  15. FE FE FE FE
    replicas: 4
    template:
    ...
    labels:
    role: frontend
    stage: production
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Kubernetes - Master/Scheduler
    Replication Controller

    View Slide

  16. FE
    replicas: 1
    template:
    ...
    labels:
    role: frontend
    stage: production
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Kubernetes - Master/Scheduler
    Replication Controller

    View Slide

  17. FE FE FE
    replicas: 3
    template:
    ...
    labels:
    role: frontend
    stage: production
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Kubernetes - Master/Scheduler
    Replication Controller

    View Slide

  18. id: backend-service
    port: 9000
    labels:
    role: backend
    stage: production
    Backend Service
    BE BE BE BE
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Machine
    Host
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Container
    Agent
    Kubernetes - Master/Scheduler
    Service

    View Slide

  19. Cat in a Container

    View Slide

  20. We’re taking lessons we’ve learned and open sourcing them
    Kubernetes is evolving
    We’re eager to hear from you!
    1
    2
    3
    Summing Up

    View Slide

  21. We are just getting started...
    Clone Kubernetes at:
    github.com/GoogleCloudPlatform/kubernetes
    IRC: #google-containers on Freenode
    Google group: google-containers
    Reach out:
    [email protected]
    Twitter: @jbeda

    View Slide