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

Kubernetes Design Principles: Understand the Why

Saad Ali
December 14, 2018

Kubernetes Design Principles: Understand the Why

Kubecon Seattle 2018 Talk - https://sched.co/IrkE

Kubernetes is quickly becoming indispensable for managing and deploying workloads on distributed systems across both cloud and on-prem environments.

While most people are now familiar with how to use Kubernetes, few are aware of the “why” behind it? Why does the Kubernetes API look the way it does? Why do Kubernetes components only interact with each other through the Kubernetes API? Why is there a PersistentVolumeClaim object when you could easily reference a volume directly from a pod?

To answer these questions and help you develop a deeper understanding of Kubernetes, this talk exposes the principles underpinning the design of Kubernetes.

Saad Ali

December 14, 2018
Tweet

More Decks by Saad Ali

Other Decks in Programming

Transcript

  1. You: System: Master: API Server Node A Node B kubectl

    create -f replica.yaml apiVersion: apps/v1 kind: ReplicaSet metadata: name: frontend spec: replicas: 1 template: metadata: ... spec: ... containers: - name: nginx image: internal.mycorp.com:5000/mycontainer:1.7.9
  2. Master: API Server Node A Node B Master: Scheduler Pod

    A Pod A definition node: Node B kubectl delete pod A
  3. Principle: Obvious solution: Master Node 1 API Server Scheduler Kubelet

    Watch for new Pods, scheduled to this node Docker Daemon Pod A node: Node1 Container for pod1 Fetch Secret Object Watch for new Pods
  4. Before: After: Master Node 1 API Server Scheduler Kubelet Watch

    for new Pods, scheduled to this node Docker Daemon Pod A node: Node1 Container for pod1 Watch for new Pods Secret volume Fetch Secret file
  5. Master Node 1 API Server Scheduler Kubelet Watch for new

    Pods, scheduled to this node Docker Daemon Pod A storage: gcePD1 Fetch Secret Object Watch for new Pods
  6. Master Node 1 API Server Scheduler Kubelet Watch for new

    Pods, scheduled to this node Docker Daemon Pod A storage: gcePD1 node: Node1 Fetch Secret Object Watch for new Pods Schedule PodA to Node1
  7. Master Node 1 API Server Kubelet Watch for new Pods,

    scheduled to this node Docker Daemon Pod A storage: gcePD1 node: Node1 Fetch Secret Object A/D Controller Watch for new Pods w/Volumes Storage Backend Attach gcePD1 to Node1
  8. Master Node 1 API Server Kubelet Watch for new Pods,

    scheduled to this node Docker Daemon Pod A storage: gcePD1 node: Node1 Fetch Secret Object A/D Controller Watch for new Pods w/Volumes Storage Backend Attach gcePD1 to Node1 gcePD1
  9. Master Node 1 API Server Kubelet Watch for new Pods,

    scheduled to this node Docker Daemon Pod A storage: gcePD1 node: Node1 Fetch Secret Object A/D Controller Watch for new Pods w/Volumes Storage Backend Attach gcePD1 to Node1 gcePD1 Container for pod1 Create container Mount volume
  10. Master Node 1 API Server Kubelet Watch for new Pods,

    scheduled to this node Docker Daemon Pod A storage: gcePD1 node: Node1 Fetch Secret Object A/D Controller Watch for new Pods w/Volumes Storage Backend Attach gcePD1 to Node1 gcePD1 Container for pod1 Create container Mount volume
  11. Master Node 1 API Server Kubelet Watch for new Pods,

    scheduled to this node Docker Daemon Pod A storage: pvc-a node: Node1 Container for pod1 gcePD1 A/D Controller Watch for new Pods w/Volumes Watch state of container pvc-a storage: pv-1 storageClass: storageClass1 pv-1 storage: gcePD1 StorageClass1 storage: gcePD Cluster admin facing API object User facing API object
  12. Master Node 1 API Server Kubelet Watch for new Pods,

    scheduled to this node Docker Daemon Pod A storage: pvc-a node: Node1 Container for pod1 awsEBS1 A/D Controller Watch for new Pods w/Volumes Watch state of container pvc-a storage: pv-1 storageClass: storageClass1 pv-1 storage: awsEBS1 StorageClass1 storage: awsEBS Cluster admin facing API object User facing API object