Kubernetes
@erialc_w
● ops at Treeptik:
- CloudUnit: Java PaaS based on
Docker
● orchestration:
- on a single host with docker-
compose
- on a containers cluster:
Kubernetes, mesos, swarm...
I. Docker and Kubernetes
II. Kubernetes concepts
III. Demo
Before Docker
● Dedicated machines for each service
● Management (Chef, Puppet, Salt,
Ansible…)
● Machines (physical, cloud)
● app dependencies, scaling, upgrade,
rollbacks...
Docker Containers
Container
● process isolation
● namespace isolation
● own network interface
● own filesystem
Microservice
● one container = one
process
Docker Compose
● orchestrate containers
● links
● volumes-from
● on a single host !!!
Docker Swarm
● Pool of Docker hosts
● Native clustering:
extends the
Docker API
Kubernetes Clusters
● Open source
● (Very!) Active
development
● Scheduler: cluster
orchestration
system
II. Kubernetes concepts
Key concepts
Pod
● smallest deployable unit
● shared context
Label
● key/value pair
● organize, select objects
Replication Controller
● N pods running
● pod template
Service
● targets pods
● long-lived
Pods
Pod
Webserver
Content
Management
Server
● Set of containers
● Settings in a template
● Flat shared networking
namespace
● Shared storage volumes
Labels
● Metadata with semantic meaning
● Label selector
set of objects
Replication controllers
Replication
Controller
#Pods: 2
label selector: v1
Replication
Controller
#Pods: 1
label selector: v2
Pod Pod
Pod
v1 v1
v2
● Keeps pods running
● Direct control of pods
Services
Service
label selector: FE
Pod
FE
● Automatically configured load balancer
● Stable address
● Decoupled from controller
Replication
Controller
#Pods: 2
label selector: FE,
v1
v1
Pod
FE
v1
Scaling
Service
label selector: FE
Pod
FE
Replication
Controller
#Pods: 2
label selector: FE,
v1
v1
Pod
FE
v1
Pod
FE
v1
Replication
Controller
#Pods: 3
label selector: FE,
v1
Rolling update
Service
label selector: FE
Pod
FE
Replication
Controller
#Pods: 3
label selector: FE,
v1
v1
Pod
FE
v1
Pod
FE
v1
Replication
Controller
#Pods: 2
label selector: FE,
v2
v2 v2
III. Demo
Problems solved
● dependencies
● upgrade
● scale
● rollbacks
Kubernetes architecture
Node
kubelet proxy
docker
Pod
Master
API
scheduler
replication
controller
distributed
storage
kubectl
Pod

Kubernetes