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 Photographer flickr.com/saturnism @saturnism @googlecloud #kubernetes
@saturnism @googlecloud #kubernetes
Let's go Production! @saturnism @googlecloud #kubernetes
When will the production environment be ready? 6 months later…? Maybe? @saturnism @googlecloud #kubernetes
It works in staging… But not in production! @saturnism @googlecloud #kubernetes
Containerize! Runtime + Application Like a static binary! @saturnism @googlecloud #kubernetes
Containers app app libs libs app app libs libs kernel @saturnism @googlecloud #kubernetes
Containers Orchestration @saturnism @googlecloud #kubernetes
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
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
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
Cluster of Machines as One @saturnism @googlecloud #kubernetes
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
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
Cluster of Machines as One @saturnism @googlecloud #kubernetes
@saturnism @googlecloud #kubernetes
Guestbook Hello World Service - Create Service - Greet Guestbook Service - Retrieve @saturnism @googlecloud #kubernetes
Guestbook Hello World greeting UI Service CRUD Guestbook Service session replication Redis MySQL @saturnism @googlecloud #kubernetes
Minikube - Get Started Locally @saturnism @googlecloud #kubernetes
Pods Group of containers Pod App Live and die together Shared network interface Log Collector Shared volumes ... Unique Routable IP @saturnism @googlecloud #kubernetes
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
Labels Pod App Label anything Log Collector Name-value pair Make your own ... version = 1.0 type = Frontend @saturnism @googlecloud #kubernetes
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
Replication Controllers Replication Controller Pod Replicas → 1 App Log Collector ... version = 1.0 type = Frontend @saturnism @googlecloud #kubernetes
Replication Controllers Replication Controller - Desired = 4 - Current = 4 b0111 f0118 node 3 node 1 a1209 d9376 node 4 node 2 @saturnism @googlecloud #kubernetes
Replication Controllers Replication Controller - Desired = 4 - Current = 4 b0111 f0118 node 3 node 1 a1209 d9376 node 4 node 2 @saturnism @googlecloud #kubernetes
Replication Controllers Replication Controller - Desired = 4 - Current = 3 b0111 f0118 node 3 node 1 a1209 node 4 @saturnism @googlecloud #kubernetes
Replication Controllers Replication Controller - Desired = 4 - Current = 4 b0111 f0118 c9bad node 3 node 1 a1209 node 4 @saturnism @googlecloud #kubernetes
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
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
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
Service discovery Read service IP addresses via environmental variables @saturnism @googlecloud #kubernetes
Service discovery Kubernetes API or… DNS Lookups! ping redis @saturnism @googlecloud #kubernetes
@saturnism @googlecloud #kubernetes
Next Step? Data Centers as One! @saturnism @googlecloud #kubernetes
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
Federation Kubernetes on API Kubernetes on CLI API Another Web Service Cloud UI Kubernetes on Premise Admin Control Plane Clusters @saturnism @googlecloud @kubernetesio
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
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
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
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
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
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
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
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
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
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