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.

42ff40d0d729d86739df5ede5591d4f1?s=128

GoogleCloudPlatform

August 20, 2014
Tweet

Transcript

  1. Google confidential │ Do not distribute Containerizing the Cloud with

    Kubernetes and Docker Google Cloud Platform Developer Roadshow - 2014
  2. Google confidential │ Do not distribute What is a container?

    • Lightweight Linux environment • Hermetically sealed, deployable application • Introspectable, runnable artifact • Recently popularized by Docker
  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
  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
  5. Google confidential │ Do not distribute We start over 2

    billion containers per week.
  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
  7. Google confidential │ Do not distribute Managed Base OS Node

    Container Manager Scheduled Containers Cluster Scheduler Google cluster management stack
  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
  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
  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
  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
  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
  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
  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.
  15. Google confidential │ Do not distribute Kubernetes κυβερνήτης: Greek for

    “pilot” or “helmsman of a ship” the open source cluster manager from Google
  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
  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
  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
  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
  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
  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
  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
  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
  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
  25. Google confidential │ Do not distribute Live Demo! Live Demo!

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