Kubernetes Presentation - Slides
Kubernetes Presentation - Slides
Kubernetes Presentation - Slides
PATTERNS
M i c h a e l M a n d i b e rg , C C BY - SA 2 . 0 , h t t p s : / / fl i c . k r /p / 67 C b 6 J m
DESIGN PATTERN
One or more
containers sharing: rhuss/pong:1
Volumes
Ephemeral IP address
POD DECLARATION
apiVersion: v1
kind: Pod
metadata:
name: pong
labels:
name: pong
version: "1"
spec:
containers:
- image: "rhuss/pong:1"
name: pong
ports:
- containerPort: 8080
- image: "rhuss/log-sidecar:2.3"
name: log
REPLICA SET
Responsible for managing Pods
replicas : Number of Pod copies to
keep
Label selector chooses Pods
Holds a template for creating new
Pods
ReplicaSet
replicas:
3 Selector: name: pong
version: 1
Replication
Daemon Set Replica Set Stateful Set Job
Controller
Pod
Volume
Persistent
ConfigMap Secret
Volume Claim
Declarative
Deployment
How can applications be deployed
and updated ?
Service
v 1.1 v 1.1
FIXED
v 1.0 v 1.0 v 1.0
Service
Service
v 1.1
BLUE-GREEN
v 1.0 v 1.0 v 1.0
Service
instances instances
time time
0 … 1 capacity
instances instances
time time
2x capacity
STRUCTURAL
PATTERNS
Initializer
How can I initialize my containerized
applications ?
Init container :
Part of a Pod
One shot action before Pod starts
Needs to be idempotent
Has own resource requirements
Container Container
app containers
init containers
Pod
Sidecar
How can I extend the functionality of
an existing container ?
Runtime collaboration of
containers
Connected via shared resources:
Network
Volumes
Main Container Sidecar
node.js git
Disk
Pod
Ambassador
How to decouple a container's
access to the outside world ?
python memcached
localhost
Pod
Adapter
How to decouple access to a
container from the outside world ?
Opposite of Ambassador
Uniform access to application
Examples:
Monitoring
Logging
Main Container Sidecar
java monitoring
Disk
Pod
ADVANCED
PATTERNS
Custom Controller
How can I extend the platform itself
without changing it ?
Operator
Expose
Controller
etcd
Operator EAI
Controller
ConfigMap
Controller
Prometheus
Operator
QUESTIONS ?
Twitter ro14nd
Book https://leanpub.com/k8spatterns
Slides https://github.com/ro14nd-talks/kubernetes-patterns