Upload
brendandburns
View
4.361
Download
2
Tags:
Embed Size (px)
Citation preview
Containers, Clusters & Kubernetes
Brendan BurnsStaff Software Engineer
Motivations
Make writing BigTable a CS 101
Exercise
What is a container?
What is a container?
● Lightweight Linux environment● Hermetically sealed, deployable
application● Introspectable, runnable artifact● Recently popularized by Docker
What is a cluster?
The transition to logical compute
VM
Logical Compute Substrate
Container
Container
Container
Container
Container
Container
Container
Container
Container
VM VM VM VM VM VM VM VMVM
Container
Container
Container
Container
Container
Container
Container
Container
Container
Modular Application Design
VM
Database
Dependencies
WebServer
MiddleWareVM
DatabaseContainer
Dependency
WebServerContainer
Dependency
MiddlewareContainer
Dependency
vs.
Modular Scaling
VMDatabase
Dependencies
WebServerMiddleWare
DatabaseContainer
Dependency
WebServerContainer
Dependency
MiddlewareContainer
Dependency
vs.
VM
Dependencies
WebServerMiddleWare
Database
VM
Dependencies
WebServerMiddleWare
Database
VM VM
MiddlewareContainer
Dependency
WebServerContainer
Dependency
WebServerContainer
Dependency
What is Kubernetes?
● Open source container cluster manager● Inspired by the technology that drives
● Runs anywhere:○ Public Cloud○ Private Cloud○ Bare Metal
● Strong ecosystem○ Partners: Red Hat, VMWare, CoreOS,
Microsoft, ...○ Community: Client libs, integration, ...
The Cloud Dichotomy
IaaS
PaaS
A brief history of programming languages
Assembly
PostScript
Assembly
A brief history of programming languages
Assembly
PostScript
AssemblyObject Oriented Languages
The Cloud Dichotomy
PaaS
IaaS
IaaSCaaS
Components
Kubernetes Pod
Components: Pods
Container-1 Container-2
Shared Volume(s)
Kubernetes Pod
Components: Sidecars
Serving Container
Git Sync Container
Shared Volume
Git Repo
Sidecars Extend and Enhance
Components: Adapters
Kubernetes Pod
Redis Service Redis Adapter
Kubernetes PodMongoDB Service
MongoDB Adapter
Kubernetes PodMySQL Service
MySQL Adapter
Monitoring Service
Adapters Normalize and Abstract
Kubernetes Pod
Components: Ambassadors
Frontend Container
MySQL Ambassador
Write Master
Read Slaves
Container Container Container
Container
localhost
Ambassadors Proxy and Represent
Encapsulation
Abstractions, ftw! : Reliability
{Container, Health Check}
Kubernetes
Container
Web: http://<container>/some/path/to/healthShell: exec /some/path/health.shTCP: open <container> <port>
Abstractions, ftw! : Replication
{Template, Identifier, Num. Replicas}
Replication Controller
Container Container Container Container
Abstractions, ftw! : Services
{IP:Port, Identifier, Name}
DiscoverableService
Container Container Container Container
DNS
Service IPContainer
Patterns
Patterns and Interfaces: Master Election
Container Container Container Container
Cluster Manager
Lock Service
http://<container>/healthz
Patterns and Interfaces: Master Election
Container Container Container Container
Lock Service
Cluster Manager
http://.../master?master=container1
Patterns: Sharded HTTP Service
Container Container Container
Kubernetes Service
http://foo.com/beta http://foo.com/gammahttp://foo.com/alpha
http://foo.com/alphahttp://foo.com/betahttp://foo.com/gamma
Patterns: Hot Sharded HTTP Service
Container Container Container
http://foo.com/alpha http://foo.com/betahttp://foo.com/gamma
http://foo.com/alpha
http://foo.com/alpha @ 20 qpshttp://foo.com/beta @ 5 qpshttp://foo.com/gamma @ 5 qps
Kubernetes Service
http://.../api/get?key=<key>http://.../api/set?key=<k>&val=<v>
Patterns: Bigtable
Container
Kubernetes Service
http://.../manage/shard/<shard>/splithttp://.../manage/shard/<shard>/mergehttp://.../manage/shard/<shard>/loadhttp://.../manage/shard/<shard>/unload
Data Interface
Management Interface
We’re building an os for the datacenter.
Join us!#google-containers on FreeNodehttps://github.com/GoogleCloudPlatform/kuberneteshttps://cloud.google.com/container-engine/
Stop