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

Kubernetes 101 - GDG Cloud Vancouver

Vikram
August 08, 2017

Kubernetes 101 - GDG Cloud Vancouver

Kubernetes 101 - GDG Cloud Vancouver

Vikram

August 08, 2017
Tweet

More Decks by Vikram

Other Decks in Technology

Transcript

  1. 7 Dependency Matrix Dev 1 Laptop Dev 2 Laptop QA

    Stage Production OS ? ? ? ? ? Frontend ? ? ? ? ? Services ? ? ? ? ? Database ? ? ? ? ? Logs ? ? ? ? ?
  2. 8 Dependency Matrix Dev 1 Laptop Dev 2 Laptop QA

    Stage Production OS OS X Windows Debian Debian Debian Frontend nginx (homebrew) nginx (download) nginx (apt-get) nginx (apt-get) nginx (apt-get) Services php (homebrew) php (download) php (apt-get) php (apt-get) php (apt-get) Database mysql (download) mysql (download) mysql (apt-get) mysql (apt-get) mysql (apt-get) Logs /usr/local/etc/nginx/logs/ C:\nginx-1.9.5\logs /var/log/nginx/ /var/log/nginx/ /var/log/nginx/
  3. 13 Dependency Matrix Dev 1 Laptop Dev 2 Laptop QA

    Stage Production OS Frontend Services Database Logs
  4. 14 14 But that's just one machine! Discovery Scaling Security

    Monitoring Configuration Scheduling Health
  5. 15 Kubernetes Manage applications, not machines Open source, open API

    container orchestrator Supports multiple cloud and bare-metal environments Inspired and informed by Google’s experiences and internal systems
  6. 16 16 Kubernetes Concepts Cattle > Pets No grouping Modular

    Control Loops Network-centric Open > Closed Simple > Complex Legacy compatible
  7. 18 Cattle vs Pets Cattle • Has a number •

    One is much like any other • Run as a group • If it gets ill, you make hamburgers Pet • Has a name • Is unique or rare • Personal Attention • If it gets ill, you make it better
  8. 24 Children vs Employees Child • Go upstairs • Get

    undressed • Put on pajamas • Brush your teeth • Pick out 2 stories Employee • Go get some sleep
  9. 26 Pods Logical Application • One or more containers and

    volumes • Shared namespaces • One IP per pod Pod nginx monolith NFS iSCSI GCE 10.10.1.100
  10. 31 Monitoring and Health Checks OK, then I’m going to

    restart you... Node Kubelet Pod app v1 app v1
  11. 37 Secrets and Configmaps Kubernetes Master etcd API Server Node

    Kubelet secret $ kubectl create secret generic tls-certs --from-file=tls/
  12. 38 Secrets and Configmaps Kubernetes Master etcd API Server Node

    Kubelet pod $ kubectl create -f pods/secure-monolith.yaml
  13. 40 Secrets and Configmaps Kubernetes Master etcd API Server Node

    Kubelet API Server Node Kubelet Pod Pod secret
  14. 41 Secrets and Configmaps Kubernetes Master etcd API Server Node

    Kubelet API Server Node Kubelet Pod Pod /etc/tls secret
  15. 42 Secrets and Configmaps Kubernetes Master etcd API Server Node

    Kubelet Node Kubelet Pod Pod /etc/tls /etc/tls 10.10.1.100 secret API Server
  16. 43 Secrets and Configmaps Kubernetes Master etcd API Server Node

    Kubelet API Server Node Kubelet Pod Pod /etc/tls nginx 10.10.1.100 secret
  17. 47 Persistent Endpoint for Pods • Use Labels to Select

    Pods Services Pod hello Service Pod hello Pod hello
  18. 48 Labels Arbitrary meta-data attached to Kubernetes object Pod hello

    Pod hello labels: version: v1 track: stable labels: version: v1 track: test
  19. 49 Labels selector: “version=v1” Pod hello Pod hello labels: version:

    v1 track: stable labels: version: v1 track: test
  20. 50 Labels selector: “track=stable” Pod hello Pod hello labels: version:

    v1 track: stable labels: version: v1 track: test
  21. 51 Services Persistent Endpoint for Pods • Use Labels to

    Select Pods • Internal or External IPs Pod hello Service Pod hello Pod hello
  22. 55 Drive current state towards desired state Deployments Node1 Node2

    Node3 Pod hello app: hello replicas: 3 Pod hello Pod hello
  23. 56 Drive current state towards desired state Deployments Node1 Node2

    Node3 Pod hello app: hello replicas: 3 Pod hello
  24. 57 Drive current state towards desired state Deployments Node1 Node2

    Node3 Pod hello app: hello replicas: 3 Pod hello Pod hello
  25. 59 Rolling Update Node1 Node3 Node2 ghost Pod app v1

    Service ghost Pod app v1 Pod app v1
  26. 60 Rolling Update Node1 Node3 Node2 ghost Pod app v1

    Service ghost Pod app v1 Pod app v1 Pod app v2
  27. 61 Rolling Update Node1 Node3 Node2 ghost Pod app v1

    Service ghost Pod app v1 Pod app v1 Pod app v2
  28. 62 Rolling Update Node1 Node3 Node2 ghost Pod app v1

    Service ghost Pod app v1 Pod app v1 Pod app v2
  29. 64 Rolling Update Node1 Node3 Node2 Service ghost Pod app

    v1 Pod app v1 Pod app v2 Pod app v2
  30. 65 Rolling Update Node1 Node3 Node2 Service ghost Pod app

    v1 Pod app v1 Pod app v2 Pod app v2
  31. 66 Rolling Update Node1 Node3 Node2 Service ghost Pod app

    v1 Pod app v1 Pod app v2 Pod app v2
  32. 73 Kubernetes Manage applications, not machines Open source, Open API

    container orchestrator Supports multiple cloud and bare-metal environments Inspired and informed by Google’s experiences and internal systems
  33. 74 Container • Subatomic unit in Kubernetes • Can use

    Dockerfile just like you’re used to
  34. 75 Pods Logical Application • One or more containers and

    volumes • Shared namespaces • One IP per pod Pod nginx monolith NFS iSCSI GCE 10.10.1.100
  35. 77 Secrets and Configmaps Kubernetes Master etcd API Server Node

    Kubelet secret $ kubectl create secret generic tls-certs --from-file=tls/
  36. 78 Services Persistent Endpoint for Pods • Use Labels to

    Select Pods • Internal or External IPs Pod hello Service Pod hello Pod hello
  37. 79 Labels Arbitrary meta-data attached to Kubernetes object Pod hello

    Pod hello labels: version: v1 track: stable labels: version: v1 track: test
  38. 80 Drive current state towards desired state Deployments Node1 Node2

    Node3 Pod hello app: hello replicas: 3 Pod hello Pod hello
  39. 81 Rolling Update Node1 Node3 Node2 ghost Pod app v1

    Service ghost Pod app v1 Pod app v1 Pod app v2
  40. 82 But wait there’s more. • Persistent disks • Logging

    & Monitoring • Node & Pod Autoscaling • Web UI • Jobs & Daemon Sets • Cluster Federation • Ingress