Slide 1

Slide 1 text

A Developers Guide to Containers and Google Cloud Platform GDG Silicon Valley Mandy Waite @tekgrrl google.com/+MandyWaite

Slide 2

Slide 2 text

• [TBD] • More than a Sandbox, Less than a VM • Lightweight Linux environment • Hermetically sealed, deployable system • Introspectable, runnable artifact • Recently popularized by Docker What is a container?

Slide 3

Slide 3 text

My Life with Containers I • Solaris Zones, circa 2005 • Shared Hardware Resources • Resource, Fault and Security Isolation • Branded Zones • Now owned by a Database Company Solaris Zones

Slide 4

Slide 4 text

Everything at Google runs in a container Internal usage: • Resource isolation and predictability • Quality of Services • batch vs. latency sensitive serving • Overcommitment (not for GCE) • Resource Accounting We start over 2 billion containers per week My Life with Containers II

Slide 5

Slide 5 text

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 Why should developers Care?

Slide 6

Slide 6 text

Managed Base OS Node Container Manager Scheduled Containers Cluster Scheduler Google Internal cluster management stack

Slide 7

Slide 7 text

Containers and Google Cloud Platform

Slide 8

Slide 8 text

Managed Base OS Node Container Manager Scheduled Containers Cluster Scheduler Node container management on the Google Cloud Container Optimized VM Image Container health monitoring and restart Declarative Container Manifest

Slide 9

Slide 9 text

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 container-vm-v20140929 --image-project google-containers command line containers.yaml VM www 8080 80

Slide 10

Slide 10 text

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 Disk Volume

Slide 11

Slide 11 text

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 12

Slide 12 text

Container VMs in Google Compute Engine Cloud VMs optimized for Containers Easy way to use Containers on the Google Cloud Platform: • Image preinstalled with: Docker, Node Container Manager • Loads Container Manifest at VM start time • [Soon] Integrate with UI, logging • [Soon] Basic building block for dynamic systems Also used by Managed VMs driven by Google App Engine

Slide 13

Slide 13 text

Next Steps Launch a container VM: https://cloud.google.com/compute/docs/containers Send us comments/ideas: Discussion group: groups.google.com/forum/#! forum/google-containers IRC: #google-containers on irc.freenode.net Stack Overflow: Use "google-compute-engine" and "docker" tags

Slide 14

Slide 14 text

Containers and PaaS

Slide 15

Slide 15 text

App Engine Preview Managed VMs

Slide 16

Slide 16 text

Dockerfile app.yaml All you need Your app Cloud SDK gcloud app run or gcloud app deploy Docker registry VM* container dockerd *A VM running Docker…

Slide 17

Slide 17 text

app.yaml module: solver version: dockerizing runtime: python27 api_version: 1 threadsafe: on vm: true handlers: - url: .* script: main_solver.APP vm_settings: machine_type: n1-standard-1 apt_get_install: python-opencv manual_scaling: instances: 2

Slide 18

Slide 18 text

docker build using google/docker-registry container Google Compute Engine instance your laptop docker run gcloud deploy start update using google/docker-registry container private Google Cloud Storage bucket Google App Engine Your awesome docker image Your awesome docker image docker container docker push docker pull Behind the Scenes

Slide 19

Slide 19 text

Storage: Cloud Datastore, Cloud SQL, Cloud Storage Memcache Task Queue Cloud Endpoints Find more! https://cloud.google.com/products/app-engine/ App Engine APIs

Slide 20

Slide 20 text

Dockerfile FROM google/appengine-python27 app.yaml runtime:

Slide 21

Slide 21 text

App Engine for Docker Simple to manage Private Registry Bucket APIs and SDK Load Balancing Autoscaling Docker for App Engine Use any library Run any code Transparency New Runtimes, build your own! +

Slide 22

Slide 22 text

https://cloud.google.com/appengine/docs/managed-vms/

Slide 23

Slide 23 text

Kubernetes

Slide 24

Slide 24 text

Kubernetes the open source cluster manager from Google github.com/GoogleCloudPlatform/kubernetes Runs on ● your dev machine ● your own hardware ● cloud Microsoft, IBM, Red Hat, Docker, Mesosphere, SaltStack, CoreOS and VMware have joined the Kubernetes project

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

Pods Pod Container Container Container Container • Tightly coupled group of containers • Unit of scheduling, deployment and replication • Shared storage volumes • Shared Network and Port namespace

Slide 27

Slide 27 text

Machine Machine Replication Controller • “Pod Factory” • Creates and manages a set of pods • Ensures that required number of Pods are running • Creates and kills Pods as required ReplicationController Template Pod Container Container Container Container Pod Container Container Container Container Pod Container Container Container Container Pod Container Container Container Container

Slide 28

Slide 28 text

Demo

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

https://github.com/GoogleCloudPlatform/kubernetes http://googlewebcomponents.github.io/

Slide 31

Slide 31 text

End