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

A Developers Guide to Containers and Google Cloud Platform

A Developers Guide to Containers and Google Cloud Platform

Talk presented at GDG Silicon Valley event on 10/1/2014

GoogleCloudPlatform

October 03, 2014
Tweet

More Decks by GoogleCloudPlatform

Other Decks in Technology

Transcript

  1. A Developers Guide to Containers and Google Cloud Platform GDG

    Silicon Valley Mandy Waite @tekgrrl google.com/+MandyWaite
  2. • [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?
  3. 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
  4. 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
  5. 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?
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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…
  13. 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
  14. 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
  15. Storage: Cloud Datastore, Cloud SQL, Cloud Storage Memcache Task Queue

    Cloud Endpoints Find more! https://cloud.google.com/products/app-engine/ App Engine APIs
  16. 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! +
  17. 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
  18. Managed Base OS kubelet Scheduled Containers Managed Base OS kubelet

    + Docker Containers Kubernetes Master etcd Kubernetes Container Stack
  19. 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
  20. 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
  21. End