• Web servers Keeps states • Databases • Message queues Daemon that runs as a background process • Cluster storage • Logs collection • Node monitoring DAEMON Batch processing of independent work items • Emails to send • Frames to render BATCH STATELESS STATEFUL Application Patterns
persistent states Scale is easy Availability > Consistency Create multiple replicas of the same pod Pods are disposable Rolling update Update at a controlled rate Block updates on failure History and rollback
node Pod Container Container Pod Container Container Service C async Demo: https://github.com/janetkuo/k8s-demos/tree/master/dep 01 Deployment For Stateless Pattern
persistent data Need stable, unique, and sticky identity and storage Consistency > Availability Create similar pods, each has its own identity and storage Pods are not disposable Deploy, scale, terminate In order (default), or in parallel (1.7 feature) Rolling update (1.7 feature) Update one pod at a time, and block updates on failure History
node Pod 0 Container Container Pod 1 Container Container Service C async Demo: https://github.com/janetkuo/k8s-demos/tree/master/stateful 02 StatefulSet For Stateful Pattern
Daemon per node Background process Daemons created and removed with nodes Node labels Control which nodes daemons should run on Rolling update (1.6 feature) Update at a controlled rate Block updates on failure History and rollback
node Pod Container Container Pod Container Container Service C async Demo: https://github.com/janetkuo/k8s-demos/tree/master/ds 03 DaemonSet For Daemon Pattern
in Parallel How many pods can be created and running at a time Run to Completion How many pods need to complete (exit successfully) Parallel processing of independent but related work items Emails to send or frames to render
Availability • Scale & recover easily • Disposable copies of the same pod • Consistency • Unique, sticky identity and storage • Deploy, scale, and terminate in order or in parallel • One pod per node by default • Daemon pods added and removed with nodes • Use node labels to control DaemonSet for daemon pattern • Run multiple pods in parallel • Run pods to completion Jobs for batch pattern Deployment for stateless pattern StatefulSet for stateful pattern
it. Google Container Engine Google Compute Engine Run containers on Google Cloud Platform, powered by Kubernetes. Minikube Use Kubernetes locally on your laptop. Get a Kubernetes Cluster Kubernetes runs anywhere! Full list of solutions: https://kubernetes.io/docs/setup/pick-right-solution/
Charts are curated application definitions for Kubernetes Kubernetes Helm https://github.com/kubernetes/helm Helm is a tool for managing Kubernetes charts.
extensible! github.com/upmc-enterprises/elasticsearch-operator github.com/coreos/etcd-operator Write your own controllers. Use the controllers that others wrote.