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

Containerizing the Cloud with Kubernetes and Docker

Containerizing the Cloud with Kubernetes and Docker

This deck looks at Google Compute Engine integration with Docker and at Kubernetes, an Open Source Container scheduler. This deck was delivered during the Google Cloud Platform Developer Roadshow events in 2014.

GoogleCloudPlatform

August 20, 2014
Tweet

More Decks by GoogleCloudPlatform

Other Decks in Technology

Transcript

  1. Google confidential │ Do not distribute
    Containerizing the Cloud
    with Kubernetes and Docker
    Google Cloud Platform Developer Roadshow - 2014

    View Slide

  2. Google confidential │ Do not distribute
    What is a container?
    • Lightweight Linux environment
    • Hermetically sealed, deployable application
    • Introspectable, runnable artifact
    • Recently popularized by Docker

    View Slide

  3. Google confidential │ Do not distribute
    Static application environment
    = reliable deployments
    No stress deployment and update
    Why do developers care?
    Repeatable, runnable artifact
    = portability
    Develop here, run there
    Pick your cloud solely on its merits
    Loosely coupled
    = easier to build and manage
    Compose applications from micro-
    services
    Mix in and extend third party services

    View Slide

  4. Google confidential │ Do not distribute
    Everything at Google runs
    in a container.
    • Resource isolation
    • Predictability
    • Quality of service
    • Efficient overcommit
    • Resource accounting
    Images by Connie Zhou

    View Slide

  5. Google confidential │ Do not distribute
    We start over 2 billion containers per week.

    View Slide

  6. Google confidential │ Do not distribute
    Why do developers care?
    • Efficiency: optimized packing, better scaling
    • Performance: active environment tuning
    • Continuous integration: easy and reliable
    • Robustness: active monitoring, self healing
    Highly automatable = path to active management

    View Slide

  7. Google confidential │ Do not distribute
    Managed Base OS
    Node Container Manager
    Scheduled Containers
    Cluster Scheduler
    Google cluster management stack

    View Slide

  8. Google confidential │ Do not distribute
    Managed Base OS
    Node Container Manager
    Scheduled Containers
    Cluster Scheduler
    Node container management on the Google Cloud
    Container Optimized VM Image
    Standardized Declarative Container
    Manifest
    Container health monitoring and restart

    View Slide

  9. Google confidential │ Do not distribute
    version: v1beta1
    containers:
    - name: www
    image: nginx
    ports:
    - name: http
    hostPort: 8080
    containerPort: 80
    Example with nginx
    $ gcloud compute instances create my-nginx-container
    --metadata-from-file google-container-manifest=containers.yaml
    --zone us-central1-a
    --machine-type f1-micro
    --image projects/google-containers/global/images/container-vm-v20140522
    command line
    containers.yaml
    www

    View Slide

  10. Google confidential │ Do not distribute
    version: v1beta1
    containers:
    - name: www
    image: nginx
    ports:
    - name: http
    hostPort: 8080
    containerPort: 80
    - name: https
    hostPort: 443
    containerPort: 443
    Example with nginx
    containers.yaml
    www
    8080
    443
    80
    443

    View Slide

  11. Google confidential │ Do not distribute
    version: v1beta1
    containers:
    - name: www

    volumeMounts:
    - name: dataShard
    path: /mnt/shard
    readOnly: true
    - name: dataLoader

    volumeMounts:
    - name: dataShard
    path: /mnt/output
    volumes:
    - name: dataShard
    Example with data sharding
    containers.yaml
    www dataLoader
    dataShard

    View Slide

  12. Google confidential │ Do not distribute
    User Experience
    Container Env.
    User App
    Host GCE VM
    Google Provided
    OS
    monitoring agent
    logging agent
    init / systemd sshd
    docker

    View Slide

  13. Google confidential │ Do not distribute
    Managed Base OS
    Node Container Manager
    Scheduled Containers
    Cluster Scheduler
    Cluster container scheduling on the Google Cloud
    Schedule containers across machines
    Replication and resizing
    Service naming and discovery

    View Slide

  14. Google confidential │ Do not distribute
    But it takes a community...
    Containers are portable. The active management framework must be portable too:
    • Run on your development machine.
    • Run on your cloud.
    • Run on Google Cloud Platform.
    • Run a different provider or your own hardware.
    And it must be enterprise grade.
    The community is working to create a framework that runs well
    everywhere: Kubernetes
    Microsoft, IBM, Red Hat, Docker, Mesosphere, SaltStack, and
    CoreOS, have joined the family.

    View Slide

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

    View Slide

  16. Google confidential │ Do not distribute
    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

  17. Google confidential │ Do not distribute
    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

  18. Google confidential │ Do not distribute
    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

  19. Google confidential │ Do not distribute
    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

  20. Google confidential │ Do not distribute
    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

  21. Google confidential │ Do not distribute
    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
    Replica Controller

    View Slide

  22. Google confidential │ Do not distribute
    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
    Replica Controller

    View Slide

  23. Google confidential │ Do not distribute
    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
    Replica Controller

    View Slide

  24. Google confidential │ Do not distribute
    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

  25. Google confidential │ Do not distribute
    Live Demo!
    Live Demo!

    View Slide

  26. Google confidential │ Do not distribute
    We’re just getting started
    ● Clone Kubernetes at:
    https://github.com/GoogleCloudPlatform/kubernetes
    ● Check out container VMs at:
    https://developers.google.com/compute/docs/containers
    ● Join the discussion on freenode:
    http://webchat.freenode.net/?channels=google-containers

    View Slide

  27. Google confidential │ Do not distribute
    We’re taking lessons we’ve learned and open sourcing them
    Kubernetes is our evolving effort to make cluster management
    easy
    We’re eager to hear from you!
    1
    2
    3
    Summary

    View Slide

  28. Google confidential │ Do not distribute
    End

    View Slide