The Kubernetes API & Next Generation Automation Tools @ DevOpsDays India

01dc8e954957a10b428aa60b28c89d52?s=47 Ian Lewis
November 04, 2016

The Kubernetes API & Next Generation Automation Tools @ DevOpsDays India

01dc8e954957a10b428aa60b28c89d52?s=128

Ian Lewis

November 04, 2016
Tweet

Transcript

  1. Ian Lewis Developer Advocate, Google Cloud Platform The Kubernetes API

    & Next Generation Automation Tools DevOpsDays India #DevOpsDaysIN
  2. Confidential & Proprietary Google Cloud Platform 2 Ian Lewis Developer

    Advocate - Google Cloud Platform Tokyo, Japan +Ian Lewis @IanMLewis
  3. None
  4. Kubernetes is a platform for building distributed systems

  5. Your App

  6. Your Platform

  7. Google Cloud Platform users SSH SSH SSH The Clusters of

    Old server server server
  8. Google Cloud Platform users API Container Clusters Container Cluster

  9. Google Cloud Platform UI CLI API users master nodes etcd

    scheduler controllers master The 10000 Foot View kubelet kubelet kubelet kubelet kubelet kubelet kubelet kubelet kubelet
  10. Google Cloud Platform The 10000 Foot View etcd scheduler controller-manager

    apiserver kubelet docker kube-proxy iptables 1. User creates Deployment 2. API server saves info to etcd 3. CM finds Deployment and creates ReplicaSet, which creates Pods (unscheduled) 4. Scheduler schedules pods. 5. Kubelet sees pod scheduled to it and tells docker to run the container. 6. Docker pulls and runs the container. 1 2 6 3 5 4 Docker Hub / GCR 1. Deployment 2. ReplicaSet 3. etc.
  11. Google Cloud Platform observe diff act Controllers

  12. Google Cloud Platform controller-manager Deployment metadata.name: nginx Deployment Controller ReplicaSet

    Controller Scheduler
  13. Google Cloud Platform controller-manager Deployment metadata.name: nginx Deployment Controller ReplicaSet

    Controller Scheduler
  14. Google Cloud Platform controller-manager ReplicaSet metadata.name: nginx-xxxx Deployment metadata.name: nginx

    Deployment Controller ReplicaSet Controller Scheduler
  15. Google Cloud Platform controller-manager ReplicaSet metadata.name: nginx-xxxx Deployment metadata.name: nginx

    Deployment Controller ReplicaSet Controller Scheduler
  16. Google Cloud Platform controller-manager Pod metadata.name: nginx-xxxx-xxxx spec.nodeName: <null> ReplicaSet

    metadata.name: nginx-xxxx Deployment metadata.name: nginx Deployment Controller ReplicaSet Controller Scheduler
  17. Google Cloud Platform controller-manager Pod metadata.name: nginx-xxxx-xxxx spec.nodeName: <null> ReplicaSet

    metadata.name: nginx-xxxx spec.nodeName: <null> Deployment metadata.name: nginx Deployment Controller ReplicaSet Controller Scheduler
  18. Google Cloud Platform controller-manager Pod metadata.name: nginx-xxxx-xxxx spec.nodeName: node1 ReplicaSet

    metadata.name: nginx-xxxx spec.nodeName: <null> Deployment metadata.name: nginx Deployment Controller ReplicaSet Controller Scheduler
  19. Google Cloud Platform Pod metadata.name: nginx-xxxx-xxxx spec.nodeName: node1 status: Pending

    node1 kubelet docker
  20. Google Cloud Platform Pod metadata.name: nginx-xxxx-xxxx spec.nodeName: node1 status: ContainerCreating

    node1 kubelet docker
  21. Google Cloud Platform Pod metadata.name: nginx-xxxx-xxxx spec.nodeName: node1 status: ContainerCreating

    node1 kubelet docker
  22. Google Cloud Platform Pod metadata.name: nginx-xxxx-xxxx spec.nodeName: node1 status: ContainerCreating

    node1 kubelet docker Docker Hub / GCR
  23. Google Cloud Platform Pod metadata.name: nginx-xxxx-xxxx spec.nodeName: node1 status: ContainerCreating

    node1 kubelet docker nginx-xxxx-x xxx
  24. Google Cloud Platform Pod metadata.name: nginx-xxxx-xxxx spec.nodeName: node1 status: ContainerCreating

    node1 kubelet docker nginx-xxxx-x xxx
  25. Google Cloud Platform Pod metadata.name: nginx-xxxx-xxxx spec.nodeName: node1 status: Running

    node1 kubelet docker nginx-xxxx-x xxx
  26. for { resp := http.Get(secretsEndpoint) list := json.Unmarshal(resp.Body) for _,

    secret := range list.Items { data := base64Decode(secret[“data”]) if len(data[“password”]) < 10 { log.Printf(“Insecure secret: %s”, secret.Metadata.Name) http.Delete(secretsEndpoint + secret.Metadata.Name) } } }
  27. for { resp := http.Get(crontabEndpoint) list := json.Unmarshal(resp.Body) for _,

    crontab := range list.Items { addIfNew(crontab) updateIfChanged(crontab) deleteIfOld(crontab) } }
  28. Thank You