Slide 1

Slide 1 text

Docker & Pods The many forms of containers

Slide 2

Slide 2 text

Confidential & Proprietary Google Cloud Platform 2 Ian Lewis Developer Advocate - Google Cloud Platform Tokyo, Japan google.com/+IanLewis-hoge @IanMLewis

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Confidential & Proprietary Google Cloud Platform 4 What are containers?

Slide 5

Slide 5 text

Confidential & Proprietary Google Cloud Platform 5 1. Linux cgroup 2. Linux Namespace a. IPC b. Network (eth & IP address) c. Mount d. PID e. User f. UTS (Hostname & NIS) Containers

Slide 6

Slide 6 text

Confidential & Proprietary Google Cloud Platform 6 1. Linux cgroup 2. Linux Namespace a. IPC b. Network (eth & IP address) c. Mount d. PID e. User f. UTS (Hostname & NIS) Containers Container Image File System Metadata

Slide 7

Slide 7 text

Confidential & Proprietary Google Cloud Platform 7 docker run nginx

Slide 8

Slide 8 text

Google Cloud Platform Docker Containers IPC Network PID Hostname Mount nginx IPC Network PID Hostname Mount nginx IPC Network PID Hostname Mount nginx

Slide 9

Slide 9 text

Google Cloud Platform IPC Network PID Hostname Mounts nginx IPC Network PID Hostname Mount git pull IPC Network PID Hostname Mount nginx Docker Containers

Slide 10

Slide 10 text

Google Cloud Platform IPC Network PID Hostname IPC Network PID Hostname Mount git pull IPC Network PID Hostname Mount nginx VOLUME Docker Containers nginx

Slide 11

Slide 11 text

Copyright 2015 Google Inc Container Cluster Management Node Node Cluster Node

Slide 12

Slide 12 text

Copyright 2015 Google Inc Container Cluster Management Node Node Node VOLUME?? VOLUME?? Cluster

Slide 13

Slide 13 text

Copyright 2015 Google Inc Container Cluster Management Node VOLUME

Slide 14

Slide 14 text

Copyright 2015 Google Inc Container Cluster Management Node NFS NFS NAS

Slide 15

Slide 15 text

Copyright 2015 Google Inc Node Container Cluster Management Node N FS N FS NAS

Slide 16

Slide 16 text

Google Cloud Platform Pods & Docker? confd nginx HUP W RITE READ etcd CHANGE nginx.conf app app app IP Address LB

Slide 17

Slide 17 text

Google Cloud Platform Container Container Pods & Docker? confd nginx HUP W RITE READ etcd CHANGE ? ? ? ?

Slide 18

Slide 18 text

Google Cloud Platform Pods & Docker? Container nginx confd foreman

Slide 19

Slide 19 text

Google Cloud Platform Container foreman Pods & Docker? nginx confd

Slide 20

Slide 20 text

Google Cloud Platform Container foreman Pods & Docker? Everything’s A-OK!! nginx confd Crash-Restart Loop

Slide 21

Slide 21 text

Copyright 2015 Google Inc Google has been running all of it’s services in containers for about 10 years. We start about 2 billion containers per week. Images by Connie Zhou

Slide 22

Slide 22 text

Confidential & Proprietary Google Cloud Platform 22 http://research.google.com/pubs/pub43438.html

Slide 23

Slide 23 text

http://research.google.com/pubs/pub43438.html

Slide 24

Slide 24 text

Image by Connie Zhou

Slide 25

Slide 25 text

job hello_world = { runtime = { cell = 'ic' } // Cell (cluster) to run in binary = '.../hello_world_webserver' // Program to run args = { port = '%port%' } // Command line parameters requirements = { // Resource requirements ram = 100M disk = 100M cpu = 0.1 } replicas = 5 // Number of tasks } 10000 Developer View

Slide 26

Slide 26 text

Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Image by Connie Zhou Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world!

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

Google Cloud Platform Pods Small group of containers & volumes Tightly coupled The atom of scheduling & placement Shared namespace • share IP address & localhost • share IPC, etc. Managed lifecycle • bound to a node, restart in place • can die, cannot be reborn with same ID Example: data puller & web server Consumers Content Manager File Puller Web Server Volume Pod

Slide 29

Slide 29 text

Google Cloud Platform Pods & Docker? confd nginx HUP W RITE READ etcd CHANGE nginx.conf app app app IP Address LB

Slide 30

Slide 30 text

Google Cloud Platform IPC Network Pods docker … --net=container: id --ipc=container:id Hostname cgroup Web Server Pod cgroup File Puller localhost

Slide 31

Slide 31 text

Google Cloud Platform Pods (TODO) docker … --net=container: id --ipc=container:id -- pid=container:id https://github. com/docker/docker/issue s/10163 IPC Network PID Hostname cgroup Web Server cgroup File Puller localhost

Slide 32

Slide 32 text

Kubernetes Master/Scheduler Cluster: Execution Environment 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 Node

Slide 33

Slide 33 text

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 Container Container Pod

Slide 34

Slide 34 text

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 How to differentiate multiple pods?

Slide 35

Slide 35 text

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 36

Slide 36 text

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 37

Slide 37 text

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 Replication Controller: Managing Many Pods

Slide 38

Slide 38 text

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 Replication Controller: Scaling FE FE FE

Slide 39

Slide 39 text

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 Replication Controller: Scaling

Slide 40

Slide 40 text

Thank you! Thanks! Ian Lewis twitter.com/IanMLewis