Successfully reported this slideshow.
Your SlideShare is downloading. ×

Slides - Kubernetes on GKE.pdf

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 43 Ad

More Related Content

Recently uploaded (20)

Advertisement

Slides - Kubernetes on GKE.pdf

  1. 1. Click to edit Master title style Kubernetes on GKE An Introduction to Kubernetes on GKE Ernesto Garbarino Course Instructor
  2. 2. Click to edit Master title style About Your Instructor ● Enterprise Architect Fellow at Mphasis, a Blackstone company. ● Author of Beginning Kubernetes on the Google Cloud Platform. ● Blogger (https://garba.org) on machine learning, architecture, productivity, and software engineering. Ernesto Garbarino
  3. 3. Click to edit Master title style Course Resources Course-specific Code and Examples https://github.com/egarbarino/safari_gke Book Beginning Kubernetes on the Google Cloud Platform: A Guide to Automating Application Deployment, Scaling, and Management by Ernesto Garbarino https://learning.oreilly.com/library/view/beginning- kubernetes-on/9781484254912/
  4. 4. Click to edit Master title style Container Worker Node 1 Worker Node 2 Worker Node n Service Load Balancer ConfigMap / Secret P P P P ReplicaSet P P P P P P P P Deployment StatefulSet HPA Job CronJob DaemonSet Pod Image C C Ports Mounts K8S Master Storage (Google Disks) kubectl gcloud ~/.kube/config Docker Hub create/delete Course Summary
  5. 5. Click to edit Master title style Container Worker Node 1 Worker Node 2 Worker Node n Service Load Balancer ConfigMap / Secret P P P P ReplicaSet P P P P P P P P Deployment StatefulSet HPA Job CronJob DaemonSet Pod Image C C Ports Mounts K8S Master Storage (Google Disks) kubectl gcloud ~/.kube/config Docker Hub create/delete Course Summary S1
  6. 6. Click to edit Master title style Container Worker Node 1 Worker Node 2 Worker Node n Service Load Balancer ConfigMap / Secret P P P P ReplicaSet P P P P P P P P Deployment StatefulSet HPA Job CronJob DaemonSet Pod Image C C Ports Mounts K8S Master Storage (Google Disks) kubectl gcloud ~/.kube/config Docker Hub create/delete Course Summary S1 S2
  7. 7. Click to edit Master title style Container Worker Node 1 Worker Node 2 Worker Node n Service Load Balancer ConfigMap / Secret P P P P ReplicaSet P P P P P P P P Deployment StatefulSet HPA Job CronJob DaemonSet Pod Image C C Ports Mounts K8S Master Storage (Google Disks) kubectl gcloud ~/.kube/config Docker Hub create/delete Course Summary S1 S2 S3
  8. 8. Click to edit Master title style Container Worker Node 1 Worker Node 2 Worker Node n Service Load Balancer ConfigMap / Secret P P P P ReplicaSet P P P P P P P P Deployment StatefulSet HPA Job CronJob DaemonSet Pod Image C C Ports Mounts K8S Master Storage (Google Disks) kubectl gcloud ~/.kube/config Docker Hub create/delete Course Summary S1 S2 S3 S4
  9. 9. Click to edit Master title style Container Worker Node 1 Worker Node 2 Worker Node n Service Load Balancer ConfigMap / Secret P P P P ReplicaSet P P P P P P P P Deployment StatefulSet HPA Job CronJob DaemonSet Pod Image C C Ports Mounts K8S Master Storage (Google Disks) kubectl gcloud ~/.kube/config Docker Hub create/delete Course Summary S1 S2 S3 S4 S5 - Q&A
  10. 10. Click to edit Master title style S1.0 POLL What is your experience with the Google Cloud Platform? 1. None 2. I have just created an account 3. I have an account and have entered my credit card 4. I have run a few experiments 5. I use it in production
  11. 11. Click to edit Master title style Getting Started with GKE (50m) 1
  12. 12. Click to edit Master title style gcloud S1.1 Setting up The Google Cloud Shell and GKE
  13. 13. Click to edit Master title style Worker Node 1 Worker Node 2 Worker Node n K8S Master kubectl gcloud ~/.kube/config create/delete S1.2 Creating and Destroying Kubernetes Clusters
  14. 14. Click to edit Master title style Container Worker Node 1 Worker Node 2 Worker Node n P Pod Image C C Ports K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete S1.3 Launching Docker Containers using Pods Labels one-off steady web server
  15. 15. Click to edit Master title style Container Worker Node 1 Worker Node 2 Worker Node n P Pod Image C C Ports Mounts K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete S1.4 Managing The Pod’s Life Cycle Storage (Google Disks) Pod Life Cycle Pending Running Succeeded Failed Pending Init Pod. Initializing Running Terminatin g Init. Container Container Life Cycle Mount Storage Startup Command PostStart Hook PreStop Hook https://garba.org/article/blog/2018/k8s_pod_lc.pdf
  16. 16. Click to edit Master title style S1.5 Implementing Self-Healing Mechanisms https://garba.org/posts/2020/k8s-life-cycle/ Container Worker Node 1 Worker Node 2 Worker Node n P Pod Image C C Ports K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete Labels Storage (Google Disks) periodSeconds Probe Started initialDelaySeconds Container Created Run Probe Check (e.g. command/http/tcp) Liveness Probe Readiness Probe is the container alive? is it ready to service requests?
  17. 17. Click to edit Master title style Timer Animation 10m
  18. 18. Click to edit Master title style S2.0 POLL How would you describe a ‘Pod’ to your best friend? 1. It is some kind of music player 2. It is like a virtual machine 3. It is the mechanism by which Kubernetes controls the life cycle of containers, and establishes additional dependencies such as storage 4. It is just the way Kubernetes refers to containers 5. Don’t ask me about it. It is the worst thing about Kubernetes; it cannot launch containers straight from Docker Hub without having to wrap them in Pods first!
  19. 19. Click to edit Master title style High Availability and Service Discovery (45m) 2
  20. 20. Click to edit Master title style Container Worker Node 1 Worker Node 2 Worker Node n P ReplicaSet P P P P P P P P Pod Image C C Ports Mounts K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete S2.1 Defining and Launching Deployments 1. Creating Deployments 2. Setting # of Replicas 3. Updating Docker Image 4. Using Manifests Deployment Storage (Google Disks)
  21. 21. Click to edit Master title style Container Worker Node 1 Worker Node 2 Worker Node n P ReplicaSet P P P P P P P P Pod Image C C Ports Mounts K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete 1. Recreate 2. Rolling ○ One at a Time ○ Blue/Green S2.2 Performing Rolling and Blue/Green Deployments Deployment Storage (Google Disks)
  22. 22. Click to edit Master title style Container Worker Node 1 Worker Node 2 Worker Node n P ReplicaSet P P P P P P P P Pod Image C C Ports Mounts K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete Static vs Auto-Scaling Using The Horizontal Pod Scaler (HPA) S2.3 Instrumenting Static Scaling and Autoscaling Deployment HPA Storage (Google Disks)
  23. 23. Click to edit Master title style Container Worker Node 1 Worker Node 2 Worker Node n P ReplicaSet P P P P P P P P Pod Image C C Ports Mounts K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete S2.4 Pod-to-Pod Service Access Service 1. Pod-to-Pod (Demo) 2. Internet-to-Pod Deployment HPA Storage (Google Disks)
  24. 24. Click to edit Master title style S2.5 Publishing Services on the Public Internet Container Worker Node 1 Worker Node 2 Worker Node n P ReplicaSet P P P P P P P P Pod Image C C Ports Mounts K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete Service Load Balancer 1. Pod-to-Pod 2. Internet-to-Pod (Demo) Deployment HPA Storage (Google Disks)
  25. 25. Click to edit Master title style S2.6 Performing Zero Downtime Deployments Container Worker Node 1 Worker Node 2 Worker Node n P ReplicaSet P P P P P P P P Pod Image C C Ports Mounts K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete Service Canary Zero Downtime Deployments Load Balancer Deployment HPA Storage (Google Disks)
  26. 26. Click to edit Master title style Timer Animation 5m
  27. 27. Click to edit Master title style S3.0 POLL How do the Deployment controller and the Service controller typically collaborate? 1. The Deployment controller manages the scaling and release of new Pod versions, whereas the Service controller manages the exposure of the relevant Pods to a load balancer. 2. The Service controller controls the Deployment controller so that it can perform releases according to the load balancer’s needs.
  28. 28. Click to edit Master title style Configuration and Jobs (45m) 3
  29. 29. Click to edit Master title style S3.1 Externalizing Configuration using ConfigMap Container Worker Node 1 Worker Node 2 Worker Node n P ReplicaSet P P P P P P P P Pod Image C C Ports Mounts K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete Service Load Balancer ConfigMap Deployment HPA Storage (Google Disks)
  30. 30. Click to edit Master title style S3.2 Protecting Credentials using Secrets Container Worker Node 1 Worker Node 2 Worker Node n P ReplicaSet P P P P P P P P Pod Image C C Ports Mounts K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete Service Load Balancer ConfigMap / Secret Deployment HPA Storage (Google Disks)
  31. 31. Click to edit Master title style S3.3 Implementing Batch Processes using Jobs Container Worker Node 1 Worker Node 2 Worker Node n P ReplicaSet P P P P P P P P Pod Image C C Ports Mounts K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete Service Load Balancer ConfigMap / Secrets Job 1. Single Batch Process 2. Completion Count-Based Batch Process 3. Externally Coordinated Batch Process Deployment HPA Storage (Google Disks)
  32. 32. Click to edit Master title style S3.4 Scheduling Recurring Tasks Using CronJobs Container Worker Node 1 Worker Node 2 Worker Node n P ReplicaSet P P P P P P P P Pod Image C C Ports Mounts K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete Service Load Balancer ConfigMap / Secret Job CronJob Deployment HPA Storage (Google Disks)
  33. 33. Click to edit Master title style Timer Animation 10m
  34. 34. Click to edit Master title style S4.0 POLL What is the difference between the CronJob controller and the Job controller? 1. The Job controller is the one that actually encapsulates the intended workload, whereas the CronJob controller is just a scheduling mechanism for Jobs. 2. They are two unrelated controllers. Jobs are for one-off workloads whereas CronJobs are for recurrent ones.
  35. 35. Click to edit Master title style Further Controller Types (45m) 4
  36. 36. Click to edit Master title style S4.1 Running Server-Wide Services using DaemonSets Container Worker Node 1 Worker Node 2 Worker Node n P ReplicaSet P P P P P P P P Pod Image C C Ports Mounts K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete Service Load Balancer ConfigMap / Secret Job CronJob P P P DaemonSet Deployment HPA Storage (Google Disks)
  37. 37. Click to edit Master title style S4.2 Instrument Stateful Applications using StatefulSets Container Worker Node 1 Worker Node 2 Worker Node n P ReplicaSet P P P P P P P P Pod Image C C Ports Mounts K8S Master kubectl gcloud ~/.kube/config Docker Hub create/delete Service Load Balancer ConfigMap / Secret Job CronJob P P P DaemonSet Deployment HPA Storage (Google Disks) StatefulSet
  38. 38. Click to edit Master title style Timer Animation 10m
  39. 39. Click to edit Master title style S5.0 POLL Which statement is correct? (Select only one) 1. Both Deployments and StatefulSets create randomly-named Pods. 2. If a StatefulSet’s Pod crashes, the controller will use the next available sequence number to restart it. 3. StatefulSet’s Pods are best accessed through a Load Balancer. 4. StatefulSet’s Pod are created and destroyed in sequential, and reverse sequential order, respectively. 5. Databases implemented using StatefulSets can be easily scaled using the ‘kubectl scale’ command.
  40. 40. Click to edit Master title style Wrap Up and Q&A (20m) 5
  41. 41. Click to edit Master title style Container Worker Node 1 Worker Node 2 Worker Node n Service Load Balancer ConfigMap / Secret P P P P ReplicaSet P P P P P P P P Deployment StatefulSet HPA Job CronJob DaemonSet Pod Image C C Ports Mounts K8S Master Storage (Google Disks) kubectl gcloud ~/.kube/config Docker Hub create/delete S5.1 What We’ve Learned
  42. 42. Click to edit Master title style S5.2 Topics for Further Exploration Pods ● Multiple containers (p. 45) ● Namespaces (p. 79) ● Labels (p. 83) ● Annotations (p. 88) Service Discovery ● GKE Node-wise autoscaling (p. 126) ● DNS and namespaces (p. 139) ConfigMap and Secrets ● Large Files and Binary Data (p. 167,177) ● Docker Registry Credentials (p. 185) Jobs ● Timing out Stuck Jobs (p. 213) CronJobs ● Missed Scheduled Events (p. 235) StatefulSets ● Scaling Up and Down (p. 295-307) Cluster Architecture, Installation, And Configuration (Chp. 2) ● Role-Based Access Control Services and Networking (Chp. 5) ● Understanding Ingress Storage (Chp. 6) ● Understanding Volumes ● Understanding Persistent Volumes ● Understanding Storage Classes
  43. 43. Click to edit Master title style S5.3 Questions and Answers Course-specific Code and Examples + FAQ https://github.com/egarbarino/safari_gke

×