
Master Google Kubernetes Engine from basics to intermediate through hands-on labs, learning to set up Kubernetes clusters on GCP, deploy pods, scale, network, and manage storage.
Explore Kubernetes, an open source container orchestration tool from Google that automates deployment, scaling, and management of containerized applications, enabling production-ready microservices, load balancing, and multi-host container management.
Explore how Kubernetes, a portable extensible open source platform for managing containerized workloads, runs on GKE, Amazon Elastic Kubernetes Service, Azure, and Minikube.
Explore the monolithic approach where a single codebase and server host all features, revealing scalability, coupling, and availability drawbacks, and learn how microservices replace this model.
Compare monolithic and microservices architectures, showing how microservices split a large application into independent services with separate databases and storage. Learn how Kubernetes supports scalable, isolated feature services.
Explore how an API gateway coordinates communication between microservices, routing user requests to login, newsfeed, and other APIs, enabling loosely coupled services.
Explore the evolution from virtual machines to containers and dockers, and how containers consolidate microservices onto a server with images that bundle libraries, app files, system tools, code, and runtime.
Learn how microservices built as containers with Docker images run on servers, and how Kubernetes manages containers via autoscaling to handle varying load.
Kubernetes is an open source container orchestration and management tool that automates deployment, scaling, and load balancing of containers across virtual, physical, and cloud machines.
Trace Kubernetes origin from Google to the CNCF and explore practice with Kubernetes Playground and Classroom, cloud services like GKE, AKS, and EKS, and tools such as minikube and kubeadm.
Explore the Kubernetes architecture with a master node and worker nodes, learning how the API server, controller manager, etcd, scheduler, kubelet, and kube proxy coordinate pods.
An Nginx example demonstrates how a kubectl request reaches the API server and is coordinated by the controller and scheduler to run Nginx containers as pods.
Create Kubernetes manifests in html or json, apply them through the api server, and manage pods on worker nodes under the master's control across on-prem, vm, or cloud environments.
Learn the Kubernetes control plane master node components: API server, etcd, scheduler, and controller manager, and how the API server handles requests, scales, and stores cluster metadata in etcd.
Understand how the kube scheduler on the master node schedules pod creation and selects the best node for new pods using data from the API server, controller manager, and etcd.
Understand how the controller manager on the master node ensures actual state matches the desired state. It coordinates with the scheduler and distinguishes cloud controller manager from kube controller manager.
Create a free tier account on GCP by signing in with a valid Gmail, providing payment details, and starting with $300 credit to explore Kubernetes engine.
Log into the Google Cloud console, open Kubernetes Engine, and create a GKE cluster in standard or autopilot mode, then select region, zone, cluster name, and control plane settings.
Learn to configure a GKE cluster from basics to advanced settings: regional zones, node pools with default 3 nodes, machine types, disk and image options, networking, autoscaling, and maintenance windows.
Activate cloud shell to access your Google Kubernetes Engine cluster, view its green status in Asia-south-2, Delhi, and verify three nodes with kubectl get nodes before creating pods.
Configure kubectl to inspect a three-node GKE cluster, view node details including IP addresses, version, and image. Practice adjusting terminal preferences and using kubectl options for wide output.
Create your first pod using a yaml file by defining apiVersion, kind, metadata, and a single nginx container. Then verify with kubectl commands and observe node scheduling and image pull.
Learn to deploy an ubuntu pod in Kubernetes by creating a pod spec with a running ubuntu container, executing a bash loop, and inspecting pods with kubectl get and describe.
Create a pod named test pod from a yaml file, list pods with kubectl get pods, and view the C00 container logs with kubectl logs -f.
Learn how to run multiple containers in a single pod using a YAML file, deploy two ubuntu-based containers, and monitor them with kubectl describe, get pods, and logs.
Learn to execute a command on a specific container such as C00 inside a pod with kubectl exec. Note that the pod IP is shared by all containers.
Learn how to get a shell into a running container with kubectl exec -it, open container c00 in test pod one, then access c01 to understand pods and containers.
Create a pod with two containers: ubuntu and nginx alpine, then use kubectl exec to access each container and verify the nginx server by inspecting index.html.
Create a Kubernetes pod with a curl container that pulls curl image from Docker Hub, image pull policy IfNotPresent. Run a command that echoes pod running and sleeps two hours.
Demonstrates image pull policy behavior in Kubernetes by showing containers pulled from local images when present, pod creation timing, and back-off restarting failed containers during test curl.
Learn how Kubernetes annotations store non-identifying metadata to provide context for objects like pods and services, including linking image registries and adding descriptions.
Define environment variables for containers in a pod with two containers using a yaml file and kubectl, then verify with env output in each container.
Explore pod-to-pod communication by creating a web server pod and a test curl pod, then curl the web server’s address on port 80 to verify inter-pod networking.
Explore self-healing in Kubernetes by configuring restart policies to restart containers, including always, on failure, and never, and learn when to apply them and how a liveness probe influences restarts.
Learn how Kubernetes restart policies automatically restart containers in pods when they complete or fail. This lab uses a busybox pod with sleep 10 to illustrate the default always policy.
Explore the on-failure restart policy in Kubernetes, using a YAML pod with BusyBox to demonstrate restarts on errors and no restarts on successful completion.
Understand restart policies by comparing never, on failure, and always in a pod, and see how a never policy prevents container restarts after errors.
Learn how labels attach key-value pairs to pods and how selectors filter them with equality-based and set-based rules, using declarative manifests and kubectl labeling for production, development, and testing.
Practice labeling Kubernetes pods with env and department, and use selectors to filter and view labels with kubectl get pods -l, --show-labels, and create pods with kubectl create -f.
Explore declarative labeling with a pod manifest and imperative labeling by updating a running pod using kubectl label, demonstrated with create -f, get pods, and -L to view labels.
Learn to create pods, view their labels, and search pods by labels using kubectl, including env and class filters, with commands like get pods, show labels, and -l.
Practice using labels to search pods with kubectl, then apply set-based searches such as in and not in to filter by environment and department labels.
Learn how node selectors control pod scheduling in a Kubernetes cluster by tagging nodes with labels and using label selectors to run pods on specific nodes.
Label nodes and use a node selector to ensure pods run on a specific node. Use kubectl, labels, and manifests to troubleshoot placement and resolve pending pods.
Replication controller maintains a specified number of pod replicas, recreating failed pods to keep the app available; it uses a manifest with replicas, template, and selectors to deploy identical pods.
Learn how a replication controller creates and manages two pod replicas using a manifest, a selector, and a template, ensuring pods run on different nodes and are recreated if deleted.
Delete a pod in a replication controller and see how it instantly creates a new pod to maintain the desired replica count, using kubectl to monitor pods and describe RC.
Scale a replication controller in Kubernetes by adding or removing pods as load changes, using kubectl scale replicas to maintain performance.
ReplicaSet maintains a stable set of replica pods to guarantee a specified number of identical pods. It adds set-based selectors, advancing replication control with flexible env-based matching.
Participate in a practice lab to create a replica set that spawns multiple identical pods using a manifest, with selectors and labels, and deploying ubuntu containers via kubectl.
Scale a replica set from four to six pods with kubectl, then down to three; deleting a pod prompts the replica set to create a pod to meet the count.
Explore deployment and rollback in Kubernetes, showing how a deployment manages replicas and creates replica sets, enables versioned updates, and performs rollbacks to previous states.
Upgrade a Kubernetes app from version v1 to v2 with a deployment object, creating new replica sets and pods, and validating changes with kubectl and logs.
Roll back your deployment to the previous version using kubectl rollout undo deployment, verify with kubectl get rs and pods, and check logs to confirm version two.
Learn to roll back a Kubernetes app to a specific version using kubectl rollout history and kubectl rollout undo, review revision history, and verify with pod logs.
Explore Kubernetes networking: pods get an IP address, not individual containers, and containers inside a pod communicate via localhost, shown by ubuntu and apache containers on port 80.
Demonstrate how containers in a pod communicate over localhost by opening a port with netcat and accessing it from another container using telnet.
Explore pod-to-pod communication on the same worker node using pod IP, as two pods (nginx and httpd) exchange data via port 80 and verify with ping and curl.
Learn how a service object provides a stable IP address and DNS name to connect frontend and backend pods, keeping communication intact despite pod IP changes.
Learn how cluster ip enables internal pod communication, deploy nginx with a deployment and replica set on port 80, and use a service object to provide a stable virtual ip.
Expose an nginx pod with a service object using a stable cluster IP, mapping a cluster port to the pod’s target port and routing via selectors, even when pods restart.
Enable external access to your app by configuring a node port that exposes a port on each node, alongside the cluster IP and internal port 8080, plus a firewall rule.
Create a firewall rule to open a tcp port for nodeport access, then verify external access to an nginx web server across worker nodes.
Configure a specific node port for a Kubernetes service by editing deployment and service files, applying with kubectl, then access the web server via the external IP and port.
Explore how the load balancer service distributes incoming traffic evenly across multiple nginx pods to achieve better performance and high availability, demonstrated with a three-pod lab.
Log in to multiple web server pods, verify nginx on each, and observe index.html changes across three pods. Learn to create a service object with a load balancer.
Configure a load balancer with a service object for nginx pods. Route TCP 80 from the external IP to the cluster IP and distribute traffic evenly across three pods.
Welcome to this amazing course on Google Kubernetes Engine: Basic to Advanced on Google Cloud, featuring various real-time lab sessions.
Google Kubernetes Engine (GKE) is the simplest and most common way to set up a Kubernetes cluster on GCP.
Below is the list of assignments covered in this course.
1. Assignment: Create the First Pod Using YAML in Kubernetes GKE
2. Assignment: Kubernetes Pod Restart Policy - GKE
3. Assignment: Working with Labels and Selectors in Kubernetes GKE
4. Assignment: Scaling & Replication in Kubernetes GKE
5. Assignment: Deployment and Rollback in Kubernetes GKE
6. Assignment - Containers within a Pod Communicate via localhost in GKE
7. Assignment - Containers Communicate via localhost using a Specific Port in Kubernetes GKE
8. Assignment - Pod-to-Pod Communication via POD IP in Kubernetes GKE
9. Assignment - Kubernetes Services: ClusterIP in GKE
10. Assignment - Kubernetes Services: NodePort in Kubernetes GKE
11. Assignment - Kubernetes Services: LoadBalancer in Kubernetes GKE
12. Assignment - Create a POD with attached emptyDir volume in Kubernetes GKE
13. Assignment - Create a POD with attached hostpath volume GKE
14. Assignment - Persistent Volumes for Storage in Kubernetes Cluster GKE
Course Outline
Section 1: Kubernetes Introduction
What is Kubernetes
Why do we use Kubernetes?
Kubernetes Implementations - GCP, AWS, Azure, Minikube etc
Monolithic approach for developing applications.
Microservices Vs. Monolithic
Kubernetes Gateway API
Evolution of Containers, Dockers & VMs
Microservices running as containers
Kubernetes - Orchestration or container management tool
Features of Kubernetes
Section2: Architecture of the Kubernetes Cluster
The architecture of the Kubernetes Cluster
Understand architecture with various examples
Working with Kubernetes
Roles of Master Node
Components of Control Plane (Master Node)
API Server
Etcd
Scheduler
Controller Manager
Kubelet
Service Proxy
POD
Container Engine - Docker, Containerd, or Rocket
Section 3: Setup of Kubernetes Cluster in GCP
Set up a Kubernetes Cluster in GCP Environment
Cluster basics, Node Pools, Networking etc.
Activate cloud shell to access Kubernetes Cluster
Configure Kubectl
Section 4: Kubernetes Concepts in GCP
Create the first POD using manifest file written in YAML Language
How to deploy ubuntu pod in Kubernetes?
Check logs for pods and containers in Kubernetes
Create multiple containers in a POD
Retrieve information from running containers
Get a Shell to a Running Container
Multiple Containers in a Pod (Ubuntu, Nginx Web Sever)
Download image for containers like Curl, Ubuntu, Nginx etc.
Image Pull Policy of containers
Kubernetes Annotations
Define Environment variables
Pod-to-pod communication
Login to Cluster nodes using cloud shell or control plane
Section 5: Kubernetes Pod Restart Policy
Overview of Pod Restart Policies
Three restart policies: Always, OnFailure & Never
Lab - Restart Policy: Always
Lab - Restart Policy: OnFailure
Lab - Restart Policy: Never
Section 6: Labels and Selectors in Kubernetes
Labels & Selectors
Lab - Labels and Selectors
Commands for managing labels & selectors
Declarative vs. Imperative Kubernetes commands
Lab - Search the pod using labels
Two types Selectors
Equality Based
Set based
Lab - Search the pod using set-based
Overview of Node Selector
Lab - Create a pod on a specific node
Section 7: Scaling & Replication
What is ReplicationController - RC?
Features of RC
Lab - Create Replicas of POD using RC
Lab - Deleting a pod of ReplicationController
Lab - Scale-up & scale-down the pod: ReplicationController
What is ReplicaSet - RS?
Lab - Create Replicas of POD using ReplicaSet
Lab - Scale-up & scale-down the pod: ReplicaSet
Difference between ReplicationController & ReplicaSet
Section 8: Deployment and Rollback
Overview of Deployment and Rollback
Lab: Launch two PODs using deployment object
Lab: upgrade the application v1 to v2 using deployment object
Lab: Roll back the application to previous version
Lab: Roll back to any specific version
Section 9: Kubernetes Networking
Overview of Kubernetes Networking
Containers within a POD communicate via localhost
Containers communicate via localhost using a specific port
Pod-to-pod communication via Pod IP
Practice Lab - Pod-to-pod communication
Section 10: Kubernetes Services: ClusterIP, Nodeport and LoadBalancer
Object - Service
Why service is required?
Service type - Cluster IP, NodePort & LoadBalancer
Lab 1 - Access the Web appl using Cluster IP
Lab 2 - Access the Web appl using Cluster IP
Lab 1 - Access the Web appl using NodePort
Lab 2 - Access the Web appl using NodePort
Lab 3 - Access the Web appl using specific NodePort
About LoadBalancer
Lab 1 - Kubernetes Services: LoadBalancer
Lab 2 - Kubernetes Services: LoadBalancer
Section 11: Volumes in Kubernetes Cluster
Overview of Volumes in Kubernetes Cluster.
Volume types – EmptyDir, hostpath
Lab1: Create a POD with attached emptyDir volume
Lab2: Create a POD with attached emptyDir volume
Lab1: Create a POD with attached hostpath volume
Lab2: Create a POD with attached hostpath volume
Section 12: Persistent Volumes
Overview of Persistent volumes
Create a storage class for GKE
Create a Persistent Volume using PVC
GKE Pod With Persistent Volume
Section 13: RBAC Policies for Securing Kubernetes Cluster
Introduction
Key components of RBAC
How RBAC works?
How Role and RoleBinding Work Together
Kubernetes Roles: Defining Permissions and Access
Permissions Granted by Kubernetes Roles
Create a role
Bind the Role to a User or Service Account
Section 14: Set Up a Minikube Kubernetes Cluster on Google Cloud
Project Overview
Launch VM for Minikube Cluster
Activate Cloud Shell and Connect to VM
Minikube Kubernetes Cluster Setup – Practical Lab 1
Minikube Kubernetes Cluster Setup – Practical Lab 2
Minikube Kubernetes Cluster Setup – Practical Lab 3
Start Minikube and Deploy Nginx Pod
Section 15: Client Authentication using SSL/TLS Certificate
Set Up New Namespace & Launch Pod
Overview of Client Certificate Generation
Generate a Private Key
Generate a Certificate Signing Request (CSR)
Sign a CSR with Minikube's CA to Generate a User Certificate
Set and Verify Client Credentials in Kubernetes Config
Section 16: RBAC: Role and RoleBinding
Create a Role
Create RoleBinding to Assign Role to User
Test RBAC Permissions
Section 17: Access the K8s Minikube Cluster as a User
List and Manage Kubernetes Contexts
Set Up a New Context for a User
Verify RBAC Permissions with New Context
Modify and Test RBAC Role Permissions
Section 18: Set Up and Verify Network Policies for Pods
Introduction to Kubernetes Network Policies
Why Restrict Pod-To-Pod Communication?
Understanding K8s Network Policies and CNI Plugins
Example Use Case Scenarios
Section 19: Lab: Restrict Pod Communication Using Network Policies
Start Minikube with Cilium CNI
Create Two Pods with Labels
Verify Pod Connectivity Using Curl
Create Ingress Network Policy to Restrict Pod Access
Check if Pod-to-Pod Access is Blocked
Restrict Ingress/Egress Traffic with Network Policy
Section 20: Securely Access Minikube Cluster Using MobaXterm or PuTTY
Deploy a Virtual Machine
Add User and Setup SSH Authentication
Create SSH Key Pair
Convert Private Key to .ppk Format
VM Access Troubleshooting
Deploy Minikube on Virtual Machine
Initialize Minikube Cluster
Section 21: Secure Deployment and Access of Nginx on Kubernetes
Overview of Securing Nginx with HTTPS
Deploy and Expose a Nginx Pod to External Traffic
Access Nginx Web Server Through HTTP
Set Up Nginx on Host Machine for Accessing Nginx Pod
Access Nginx Web Server via Web Browser (HTTP Only)
Section 22: Implement HTTPS for Nginx in a K8s Cluster Using TLS Certificates
Deploy and Expose a Nginx Pod to External Traffic
Generate a self-signed TLS Certificate
Store the TLS Certificate as a Secret
Check Minikube’s Ingress Controller Status
Create Ingress Resource for HTTPS
Last Lecture