Share
Embed
Transcript
40 slides
-
Confidential & Proprietary Google Cloud Platform 2 Ian Lewis Developer
Advocate - Google Cloud Platform Tokyo, Japan google.com/+IanLewis-hoge @IanMLewis -
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 -
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 -
Google Cloud Platform Docker Containers IPC Network PID Hostname Mount
nginx IPC Network PID Hostname Mount nginx IPC Network PID Hostname Mount nginx -
Google Cloud Platform IPC Network PID Hostname Mounts nginx IPC
Network PID Hostname Mount git pull IPC Network PID Hostname Mount nginx Docker Containers -
Google Cloud Platform IPC Network PID Hostname IPC Network PID
Hostname Mount git pull IPC Network PID Hostname Mount nginx VOLUME Docker Containers nginx -
Copyright 2015 Google Inc Container Cluster Management Node Node Node
VOLUME?? VOLUME?? Cluster -
Google Cloud Platform Pods & Docker? confd nginx HUP W
RITE READ etcd CHANGE nginx.conf app app app IP Address LB -
Google Cloud Platform Container Container Pods & Docker? confd nginx
HUP W RITE READ etcd CHANGE ? ? ? ? -
Google Cloud Platform Container foreman Pods & Docker? Everything’s A-OK!!
nginx confd Crash-Restart Loop -
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 -
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 -
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! -
Kubernetes κυβερνήτης: Greek for “pilot” or “helmsman of a ship”
the open source cluster manager from Google -
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 -
Google Cloud Platform Pods & Docker? confd nginx HUP W
RITE READ etcd CHANGE nginx.conf app app app IP Address LB -
Google Cloud Platform IPC Network Pods docker … --net=container: id
--ipc=container:id Hostname cgroup Web Server Pod cgroup File Puller localhost -
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 -
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 -
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 -
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? -
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 -
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 -
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 -
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 -
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