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

Kubernetes Fundamentals

Kubernetes Fundamentals

Kubernetes. It's so hot right now. But what is it?

This session is designed to show the fundamentals of Kubernetes. It assumes you know what a container is, that Kubernetes does something called "orchestration" with it, but that's it.

We'll cover the following: Container Registry, Pods, Services, Ingress, Scaling, Networking, mounting volumes, package management (Helm) and what's next.

Tommy Falgout

June 01, 2019
Tweet

More Decks by Tommy Falgout

Other Decks in Technology

Transcript

  1. VM VM VM VM Server Host OS Hypervisor Guest OS

    Guest OS Guest OS App C App B App A Server Host OS Hypervisor
  2. VM VM VM VM Server Host OS Hypervisor Guest OS

    Guest OS Guest OS App C App B App A Server Host OS Hypervisor
  3. VM Container VM VM VM Server Host OS Hypervisor Guest

    OS Guest OS Guest OS App C App B App A Server Host OS Hypervisor Bins/Libs App A
  4. VM Container Container Container VM VM VM Server Host OS

    Hypervisor Guest OS Guest OS Guest OS App C App B App A Server Host OS Hypervisor Bins/Libs App B App C Bins/Libs App A Bins/Libs
  5. VM Container Container Container VM VM VM Server Host OS

    Hypervisor Guest OS Guest OS Guest OS App C App B App A Server Host OS Hypervisor Bins/Libs App B App C Bins/Libs App A Bins/Libs
  6. Image Name Process started in an executing container Initializes a

    new build stage and sets the base image Execute commands in a new layer on top of the current image and commit results Provide defaults for an executing container Captures the steps to build a container image Version-able asset in your DevOps flows Configuration-as-Code
  7. VM Container Container Container Server Host OS Hypervisor Bins/Libs App

    B App C Bins/Libs App A Bins/Libs Container Image Container Image Container Image Container Image Container Image Container Image
  8. VM Container Container Container Server Host OS Hypervisor Bins/Libs App

    B App C Bins/Libs App A Bins/Libs Container Image Container Image Container Image Container Image Container Image Container Image
  9. VM Container Container Container Server Host OS Hypervisor Bins/Libs App

    B App C Bins/Libs App A Bins/Libs VM Container Container Container Server Host OS Hypervisor Bins/Libs App B App C Bins/Libs App A Bins/Libs
  10. Kubernetes comes from the Greek word κυβερνήτης:, which means helmsman

    or ship pilot, ie: the captainer of a container ship. "Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications."
  11. AKS reduces the complexity and operational overhead of managing Kubernetes

    by offloading much of that responsibility to Azure. You only pay for the worker nodes within your clusters, not for the master nodes
  12. ratings-api Label(s) app=ratings-api Container-image my.azurecr.io/ratings-api Port 3001 (VolumeMount) /mnt/share (Resources)

    <cpu/memory> ratings-web Label(s) app=ratings-web Container-image my.azurecr.io/ratings-web Port 3000 (VolumeMount) /mnt/share (Resources) <cpu/memory> Pods – What are they? otherApp Label(s) app=otherApp Container-image other.azurecr.io/other App Port 4045 (VolumeMount) /mnt/share Metadata that describes how the containers are configured.
  13. Deployments Metadata that describes how to deploy a pod More

    Metadata ratings-web replicas 2 ratings-web Label(s) app=ratings-web Container- image my.azurecr.io/ ratings-web Port 3000 (Volume) … (Resources) …
  14. ratings-web2 Label(s) app=ratings-web Container- image my.azurecr.io/ ratings-web Port 3000 Services

    Metadata that describes how to reach the pods Yet More Metadata! ratings-web Selector app=ratings-web Port Mapping 8080:3000 Type (Internal or External) LoadBalancer ratings-web1 Label(s) app=ratings-web Container- image my.azurecr.io/ ratings-web Port 3000
  15. Scaling Pods ratings-web replicas 3 ratings-web Label(s) app=ratings-web Container- image

    my.azurecr.io/ ratings-web Port 3000 (Volume) … (Resources) …
  16. Scaling Pods ratings-web replicas 6 ratings-web Label(s) app=ratings-web Container- image

    my.azurecr.io/ ratings-web Port 3000 (Volume) … (Resources) …
  17. Azure Container Instances Node With Azure Container Instances Master Cluster

    Node az enable-addons –g –name –addons –subnet-name
  18. PV vs PVC Volumes emptyDir hostPath Persistent Volume Claim (PVC)

    ConfigMap Security …. Persistent Volume (PV)
  19. 1. Kubernetes users communicate with API server and apply desired

    state 2. Master nodes actively enforce desired state on worker nodes 3. Worker nodes support communication between containers Kubernetes control API server replication, namespace, serviceaccounts, etc. -controller- manager -scheduler etcd Master node Worker node kubelet Service Docker Pods Pods Worker node kubelet Service Docker Pods Pods Internet 4. Worker nodes support communication from the Internet
  20. API server Controller Manager Scheduler etcd Store Cloud Controller Self-managed

    master node(s) • Automated upgrades, patches • High reliability, availability • Easy, secure cluster scaling • Self-healing • API server monitoring • At no charge Customer VMs App/ workload definition User Docker Pods Docker Pods Docker Pods Docker Pods Docker Pods Schedule pods over private tunnel Kubernetes API endpoint Azure managed control plane
  21. Task The old way With Azure Create a cluster Provision

    network and VMs Install dozens of system components including etcd Create and install certificates Register agent nodes with control plane az aks create Upgrade a cluster Upgrade your master nodes Cordon/drain and upgrade worker nodes individually az aks upgrade Scale a cluster Provision new VMs Install system components Register nodes with API server az aks scale
  22. Helm Helm Charts helps you define, install, and upgrade even

    the most complex Kubernetes application pods services Chart.yml db deployments ci …
  23. Helm The best way to find, share, and use software

    built for Kubernetes Manage complexity Charts can describe complex apps; provide repeatable app installs, and serve as a single point of authority Easy updates Take the pain out of updates with in-place upgrades and custom hooks Simple sharing Charts are easy to version, share, and host on public or private servers Rollbacks Use helm rollout to roll back to an older version of a release with ease
  24. A fully managed service of Red Hat OpenShift on Azure,

    jointly, engineered, operated and supported by Microsoft and Red Hat