from laptop to the world
play

From Laptop to the World With Kubernetes @saturnism @googlecloud - PowerPoint PPT Presentation

From Laptop to the World With Kubernetes @saturnism @googlecloud #kubernetes Ray Tsang Developer Advocate Google Cloud Platform @saturnism | +RayTsang @saturnism @googlecloud #kubernetes Ray Tsang Developer Architect Traveler


  1. From Laptop to the World With Kubernetes @saturnism @googlecloud #kubernetes

  2. Ray Tsang Developer Advocate Google Cloud Platform @saturnism | +RayTsang @saturnism @googlecloud #kubernetes

  3. Ray Tsang Developer Architect Traveler Photographer flickr.com/saturnism @saturnism @googlecloud #kubernetes

  4. @saturnism @googlecloud #kubernetes

  5. Let's go Production! @saturnism @googlecloud #kubernetes

  6. When will the production environment be ready? 6 months later…? Maybe? @saturnism @googlecloud #kubernetes

  7. It works in staging… But not in production! @saturnism @googlecloud #kubernetes

  8. Containerize! Runtime + Application Like a static binary! @saturnism @googlecloud #kubernetes

  9. Containers app app libs libs app app libs libs kernel @saturnism @googlecloud #kubernetes

  10. Containers Orchestration @saturnism @googlecloud #kubernetes

  11. Enter Kubernetes Greek for “Helmsman” ; also the root of the word “Governor” • Container orchestrator • Runs containers • Supports multiple cloud and bare-metal environments • Inspired and informed by Google’s experiences and internal systems • Open source , written in Go Manage applications, not machines @saturnism @googlecloud #kubernetes

  12. Container Image Config Developer View file web browsers kubectl web browsers What just Kubernetes Master happened? Scheduler scheduler Kubelet Kubelet Kubelet Kubelet @saturnism @googlecloud #kubernetes

  13. Developer View spec: containers: - name: myservice image: myservice resources: limits: memory: "128Mi" cpu: "0.1" ports: - containerPort: 3306 protocol: TCP replicas: 1 10000 @saturnism @googlecloud #kubernetes

  14. Cluster of Machines as One @saturnism @googlecloud #kubernetes

  15. Container Image Config Developer View file web browsers kubectl web browsers What just Kubernetes Master happened? Scheduler scheduler Kubelet Kubelet Kubelet Kubelet @saturnism @googlecloud #kubernetes

  16. Developer View spec: containers: - name: myservice image: myservice resources: limits: memory: "128Mi" cpu: "0.1" ports: - containerPort: 3306 protocol: TCP replicas: 1 10000 @saturnism @googlecloud #kubernetes

  17. Cluster of Machines as One @saturnism @googlecloud #kubernetes

  18. @saturnism @googlecloud #kubernetes

  19. Guestbook Hello World Service - Create Service - Greet Guestbook Service - Retrieve @saturnism @googlecloud #kubernetes

  20. Guestbook Hello World greeting UI Service CRUD Guestbook Service session replication Redis MySQL @saturnism @googlecloud #kubernetes

  21. Minikube - Get Started Locally @saturnism @googlecloud #kubernetes

  22. Pods Group of containers Pod App Live and die together Shared network interface Log Collector Shared volumes ... Unique Routable IP @saturnism @googlecloud #kubernetes

  23. Inter-Pods Networking Pod IPs are routable • Docker default is private IP Pods can reach each other without NAT • even across nodes No brokering of port numbers This is a fundamental requirement • several SDN solutions @saturnism @googlecloud #kubernetes

  24. Labels Pod App Label anything Log Collector Name-value pair Make your own ... version = 1.0 type = Frontend @saturnism @googlecloud #kubernetes

  25. Replication Controllers Replication Controller Pod Pod Pod Replicas → 2 frontend App App Log Collector Log Collector ... ... version = 1.0 version = 1.0 type = Frontend type = Frontend @saturnism @googlecloud #kubernetes

  26. Replication Controllers Replication Controller Pod Replicas → 1 App Log Collector ... version = 1.0 type = Frontend @saturnism @googlecloud #kubernetes

  27. Replication Controllers Replication Controller - Desired = 4 - Current = 4 b0111 f0118 node 3 node 1 a1209 d9376 node 4 node 2 @saturnism @googlecloud #kubernetes

  28. Replication Controllers Replication Controller - Desired = 4 - Current = 4 b0111 f0118 node 3 node 1 a1209 d9376 node 4 node 2 @saturnism @googlecloud #kubernetes

  29. Replication Controllers Replication Controller - Desired = 4 - Current = 3 b0111 f0118 node 3 node 1 a1209 node 4 @saturnism @googlecloud #kubernetes

  30. Replication Controllers Replication Controller - Desired = 4 - Current = 4 b0111 f0118 c9bad node 3 node 1 a1209 node 4 @saturnism @googlecloud #kubernetes

  31. Services Replication Controller Pod Pod Pod Replicas → 2 version = 1.0 version = 1.0 frontend type = Frontend type = Frontend Service Label selectors: version = 1.0 type = Frontend @saturnism @googlecloud #kubernetes

  32. Services Pod Pod Pod Pod version = 1.0 version = 1.0 version = 2.0 frontend type = Frontend type = Frontend type = Frontend Service Label selectors: version = 1.0 type = Frontend @saturnism @googlecloud #kubernetes

  33. Services Pod Pod Pod Pod version = 1.0 version = 1.0 version = 2.0 frontend type = Frontend type = Frontend type = Frontend Service Label selectors: type = Frontend @saturnism @googlecloud #kubernetes

  34. Service discovery Read service IP addresses via environmental variables @saturnism @googlecloud #kubernetes

  35. Service discovery Kubernetes API or… DNS Lookups! ping redis @saturnism @googlecloud #kubernetes

  36. @saturnism @googlecloud #kubernetes

  37. Next Step? Data Centers as One! @saturnism @googlecloud #kubernetes

  38. Cluster / Data Center / Availability Zone containers containers containers containers API containers containers CLI containers containers containers containers UI containers containers containers containers containers Admin Control Plane Servers @saturnism @googlecloud @kubernetesio

  39. Federation Kubernetes on API Kubernetes on CLI API Another Web Service Cloud UI Kubernetes on Premise Admin Control Plane Clusters @saturnism @googlecloud @kubernetesio

  40. Federation containers containers containers containers containers containers Kubernetes on containers containers containers containers API containers containers containers containers Kubernetes on containers API CLI Another Web Service Cloud containers containers containers containers containers UI Kubernetes on containers containers Premise containers Admin containers containers containers containers containers containers containers Cluster Control Federation Federated Servers Plane Control Plane Clusters @saturnism @googlecloud @kubernetesio

  41. Initialize Federation Control Plane kubefed init my-federation --host-cluster-context=cluster-2 ... API API API API Cluster 1 Cluster 2 Cluster 3 Cluster 4 us-east1-b us-central1-b europe-west1-b asia-east1-b API Cluster 2 - us-central1-b contexts: Federation - context: Federation API Server cluster: federation-cluster Federation Controller user: federation-cluster Federation Key/value store (etcd) @saturnism @googlecloud @kubernetesio

  42. Adding a Cluster kubefed join cluster-4 --host-cluster-context=cluster2 ... Federation Control Plane API apiVersion: federation/v1beta1 kind: Cluster Cluster 4 metadata: (asia-east1-b) name: gce-asia-east1 spec: serverAddressByClientCIDRs: - clientCIDR: "0.0.0.0/0" serverAddress: "https://..." secretRef: name: gce-asia-east1 kubeconfig @saturnism @googlecloud @kubernetesio

  43. Federated Service kubectl create -f app-service.yaml Federation Control Plane Kubernetes Cluster 1 Kubernetes Cluster 2 Kubernetes Cluster 3 (Google Cloud) (On-Prem) (Another Cloud) @saturnism @googlecloud @kubernetesio

  44. Federated Service kubectl create -f app-service.yaml Federation Control Plane Kubernetes Cluster 1 Kubernetes Cluster 2 Kubernetes Cluster 3 (Google Cloud) (On-Prem) (Another Cloud) svc @saturnism @googlecloud @kubernetesio

  45. Federated Service kubectl create -f app-service.yaml Federation Control Plane Kubernetes Cluster 1 Kubernetes Cluster 2 Kubernetes Cluster 3 (Google Cloud) (On-Prem) (Another Cloud) svc svc @saturnism @googlecloud @kubernetesio

  46. Federated Service kubectl create -f app-service.yaml Federation Control Plane Kubernetes Cluster 1 Kubernetes Cluster 2 Kubernetes Cluster 3 (Google Cloud) (On-Prem) (Another Cloud) svc svc svc @saturnism @googlecloud @kubernetesio

  47. Federated Service DNS kubectl create -f app-service.yaml Federation Control Plane Kubernetes Cluster 1 Kubernetes Cluster 2 Kubernetes Cluster 3 (Google Cloud) (On-Prem) (Another Cloud) svc svc svc @saturnism @googlecloud @kubernetesio

  48. Federated Deployment kubectl create -f app-deployment.yaml Federation Control Plane Kubernetes Cluster 1 Kubernetes Cluster 2 Kubernetes Cluster 3 (Google Cloud) (On-Prem) (Another Cloud) svc svc svc @saturnism @googlecloud @kubernetesio

  49. Federated ReplicaSet kubectl create -f app-deployment.yaml Federation Control Plane Kubernetes Cluster 1 Kubernetes Cluster 2 Kubernetes Cluster 3 (Google Cloud) (On-Prem) (Another Cloud) svc app svc svc @saturnism @googlecloud @kubernetesio

Recommend


More recommend