Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Running Workloads in Kubernetes

Running Workloads in Kubernetes

An overview of built-in controllers in Kubernetes. The intended audience is Kubernetes beginners.

Kubernetes 1.7 new features are included in the slides.

#Kubernetes #K8s #containers

Janet Kuo

August 04, 2017
Tweet

More Decks by Janet Kuo

Other Decks in Technology

Transcript

  1. 9 Google Cloud Platform Master node Worker node Worker node

    Pod Container Container Pod Container Container
  2. 10 Google Cloud Platform Master node Worker node Worker node

    Pod Container Container Pod Container Container C controller
  3. 12 Google Cloud Platform No persistent states • Web frontends

    • 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
  4. 14 Google Cloud Platform 01 Deployment For Stateless Pattern No

    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
  5. 15 Google Cloud Platform kubectl Master node Worker node Worker

    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
  6. 16 Google Cloud Platform 02 StatefulSet For Stateful Pattern Store

    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
  7. 17 Google Cloud Platform kubectl Master node Worker node Worker

    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
  8. 18 Google Cloud Platform 03 DaemonSet For Daemon Pattern One

    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
  9. 19 Google Cloud Platform kubectl Master node Worker node Worker

    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
  10. 20 Google Cloud Platform 04 Jobs For Batch Pattern Run

    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
  11. 21 Google Cloud Platform kubectl Master node Worker node Worker

    node Pod Container Container Pod Container Container C async Demo: https://github.com/janetkuo/k8s-demos/tree/master/jobs 04 Jobs For Batch Pattern
  12. 23 Google Cloud Platform 4 Controllers for 4 Patterns •

    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
  13. 25 Google Cloud Platform Focus on using Kubernetes, not managing

    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/
  14. 26 Google Cloud Platform Kubernetes Package Manager Kubernetes Charts github.com/kubernetes/charts

    Charts are curated application definitions for Kubernetes Kubernetes Helm https://github.com/kubernetes/helm Helm is a tool for managing Kubernetes charts.
  15. 27 Google Cloud Platform How Do I Customize? Kubernetes is

    extensible! github.com/upmc-enterprises/elasticsearch-operator github.com/coreos/etcd-operator Write your own controllers. Use the controllers that others wrote.
  16. VM1 OS v3.14 Dependencies v1 VM2 OS v3.16 App Code

    App Code Dependencies v2 Container Container Container Dependencies v2 App Code App Code Dependencies v2 App Code Dependencies v2 Virtualized App relies on dependencies installed on the guest OS Containerized Code and dependencies packaged in modular unit Container 101