Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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.

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

Google confidential │ Do not distribute End