
Explore docker and kubernetes through a hands-on guide, learning to deploy, scale, and manage containerized apps across AWS and cloud environments with practical labs.
Begin this two-part module by Docker knowledge: start with the Docker course for beginners if needed, then Kubernetes introduction and architecture; or jump straight to Kubernetes if you know Docker.
Learn how Kubernetes, an open source container orchestration tool, automates deployment, scaling, and management of containerized apps, coordinating Docker containers for microservices and reliable production deployments.
Explain the monolithic approach to building apps, using Facebook features as an example, and show how a single code and server hinder scaling, with microservices as the remedy.
Compare monolithic and microservices architectures, showing how independent services deploy with separate databases and storage. Explain scalability by tuning individual services on separate servers to handle higher demand.
Learn how an API gateway coordinates microservice communication by routing requests to the appropriate services, illustrating loosely coupled, independently runnable login and newsfeed APIs.
Trace the evolution from VM machines to containers and Docker, and how containers package apps into images that run as isolated containers, with Kubernetes introduced for container usage.
Explore how microservices run as containers, using Docker to build images and deploy containers, and how Kubernetes manages containers, enables autoscaling, and automates container workloads in production.
Kubernetes is an open source container orchestration tool that manages containers and automates deployment, scaling, and load balancing across virtual, physical, and cloud machines.
Trace Kubernetes origins from Google to the CNCF and explore free online practice tools, cloud services like Google Kubernetes Service, AKS, EKS, and local options such as minikube and kubeadm.
Explore the Kubernetes architecture with master and worker nodes, API server as the entrance, and components like etcd, controller manager, scheduler, kubelet, and kube-proxy, plus pods and Docker-based containers.
Understand how a Kubernetes cluster handles an nginx deployment, from the API server and etcd to the scheduler and kubelet, with pod recreation on failure and IP allocation by kube-proxy.
Learn to work with Kubernetes by creating manifests in VML or JSON, applying them via the API server to deploy pods on worker nodes and understand the master’s control plane.
Explore the master node components—api server, etcd database, scheduler, and controller manager—and how the api server handles user interactions via yaml or json manifests.
Explore how the Kube scheduler selects the best node for pods, coordinating with the API server and controller manager to schedule resources based on node capacity.
Ensure the cluster's actual state matches the desired state by coordinating manifests, api server, and scheduler on the master node; cloud controller manager handles cloud, kube controller manager handles non-cloud.
Provision a three-node Kubernetes cluster on AWS with one master (t2.medium) and two workers (t2.micro), install Docker and Kubernetes packages, configure networking with Flannel, and initialize and join nodes.
Launch a Kubernetes cluster on AWS by provisioning a master node and two worker nodes with Ubuntu, and configure access via a private key using Mobaxterm.
Complete Kubernetes cluster setup across master and two worker nodes by logging in as root, updating systems, installing Docker, and configuring Kubernetes packages with GPG keys.
Initialize the Kubernetes cluster on the master node with cubeadm init, join worker nodes using the provided join command, and verify the master node while next lab will configure workers.
Configure worker nodes by running the command to join the kubernetes cluster, fix firewall port issues in the security group, and prepare for troubleshooting in the next lecture.
Resolve worker node join issues by configuring security group inbound rules to allow all traffic for master and worker nodes, then observe kubelet progress until all nodes show ready.
Explore Kubernetes cluster types from a single-node all-in-one minikube to high-availability multi-master setups with Etcd and multiple workers. See how minikube enables local Kubernetes for learning, development, and testing.
Launch an aws ubuntu minikube server on ec2, install docker and kubectl, then install minikube with vm driver none to run a single-node kubernetes cluster.
Create your first pod with YAML by defining kind pod, API version v1, and a single Ubuntu container running a while loop, then apply with kubectl and verify pods.
Create a pod from yaml by specifying kind, apiVersion, pod name, and container image, with a command. Use kubectl describe to see the pod IP, node, and events.
Learn to check pods and describe them, then stream container logs with kubectl logs -f, using -c for specific containers, and delete pods when needed.
Create a pod with two containers using yaml, apply configurations with kubectl, and verify with get pods, describe, and logs to confirm both containers run inside the pod.
Explore Kubernetes annotations to attach metadata to pods using yaml, including who created, purpose, and creation time; learn to define annotations in metadata and apply with kubectl.
Create a pod with two Ubuntu containers, then enter each container with kubectl exec -it bash to explore the environment. Explore pod ip, container details, and the Ubuntu os inside.
Define environment variables for multiple containers in a pod, assign names and values, verify with env and echo inside each container, and manage the pod with kubectl commands.
Define a container port and forward traffic to the container on port 80 using kubectl and curl verification. Learn practical port mapping with a httpd image in a Kubernetes pod.
Learn how Kubernetes uses restart policies to automatically restart containers, enabling self-healing, with three options: always, on-failure, and never, based on exit codes and liveness probes.
Demonstrate the always restart policy in Kubernetes by running a BusyBox pod that sleeps 10 seconds, then observe containers cycling between running and completed.
The on failure restart policy restarts containers only if the process exits with an error or is unhealthy, as shown by a pod finishing with zero restarts.
Explore how the never restart policy in Kubernetes prevents a container from restarting after exit or a failed liveliness probe, ideal for single-run applications.
Learn how to use labels and selectors to organize Kubernetes pods by environment and department. Explore declarative labeling, interactive label updates, and equality- and set-based selectors with kubectl commands.
Practice lab demonstrates creating a pod with a manifest and labels, applying it with kubectl, and using kubectl get pods and kubectl get pods --show-labels and -l for label-based searches.
Compare declarative and imperative methods to define and query pod labels and selectors with kubectl, including adding labels, filtering by values, and not equal searches.
Lab covers applying yaml manifests to create pods with different labels, querying pods with label selectors, performing equality and set-based searches, and deleting pods by label.
Use node selectors to run a pod on a specific node by labeling that node and applying label selectors; the scheduler usually handles placement.
Learn to govern pod placement with a node selector by labeling a node (hardware=t2.medium), applying a yaml manifest, and verifying pod status with kubectl.
Replication controller creates and maintains a specified number of pod replicas to keep the application available, recreating crashed pods via a manifest with a selector, labels, and template.
Define a replication controller with a selector and pod template, set desired replicas, and apply with kubectl to create and manage multiple pods.
Scale up or down pods in a Kubernetes cluster by adjusting the replication controller replicas with kubectl, from five to eight or two as load changes.
Master how a replica set maintains a stable set of replica pods and guarantees a specified number of identical pods, using set-based selectors over equality-based replication controllers.
Practice creating and managing replica sets in Kubernetes by defining api version app/v1, env selectors, and pod templates; scale replicas from four to six and verify pods with kubectl.
Learn how Kubernetes deployment objects supervise pods, enable rolling updates and rollbacks, replace replica sets, and provide self-healing by recreating pods when failures occur.
Create and manage a Kubernetes deployment with two pods using a replica set and label selectors, then verify deployment status with kubectl get deploys, get pods, and logs.
Upgrade the app from version 1 to 2 using a Kubernetes deployment: modify the manifest, apply changes, and verify new replica sets, pods, and logs.
Master the rollback of a Kubernetes deployment by undoing a rollout with kubectl, switching between version three and version two, while watching pods, replica sets, and logs.
Learn to roll back your application to a specific deployment revision using kubectl rollout history and kubectl rollout undo, verify active pods, replica sets, and logs.
Explore Kubernetes networking by learning how pods assign ip addresses and enable container-to-container communication inside a pod using localhost, including a two-container pod example with port 80.
Open port 8081 on one container with netcat, verify it with netstat, then test inter-container communication from another container using telnet to localhost 8081.
Explore pod to pod communication within a Kubernetes cluster by using pod IPs on the same worker node, and test access with curl between Nginx and Apache pods.
Learn how the service object uses a selector to connect frontend and backend pods, providing a stable IP address and DNS name even as pods recreate with new IPs.
Demonstrates deploying a single pod via deployment, managing replicas with a replica set, and exposing the app inside the cluster with a cluster IP service for port 80 access.
Create and apply a service that exposes the deployment inside the cluster via a stable cluster IP on port 80, routing to the labeled pod.
Use a node port to access a Kubernetes app from outside the cluster, mapping to a public IP and port 80.
Understand how volumes in Kubernetes attach a storage medium to a pod and share data between containers within the same pod, with empty volumes created on pod assignment.
Perform a hands-on kubernetes lab to create a pod with two containers sharing an emptyDir volume, mounting the volume at synchronized paths and verifying file reflection across containers.
Deploy a deployment with a test volume attached to the container, then delete the pod to show a new pod starts with a clean state and no previous data.
Demonstrates creating a pod with a hostpath volume that is shared across containers and accessible from the host, ensuring data persists across pod recreation.
Delete a pod to see the deployment recreate it through the replica set, then verify that data on the host path volume remains accessible from the new pod.
Course Description:
Section 1: Kubernetes Introduction
What is Kubernetes
Why do we use Kubernetes?
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 AWS Environment
Setup Kubernetes Master and Worker Node on AWS Environment
Update the System
Install HTTP package
Docker Installation
Setup open GPG Key
Install the Kubernetes packages
Bootstrapping the master node
Configure Worker Nodes
Section 4: Kubernetes Concepts - Cluster types, Minikube Server, YAML, Pod, Kubelet, Ports
Kubernetes Cluster
Types of Cluster
All-in-one (Single Node Cluster)
Single-node, single-master, and multi-worker node clusters.
Single-Node etcd, multi-Master, and Multi-Worker Node Cluster.
About Minikube
Installation of Minikube Server
Create the first POD using manifest file written in YAML Language
Kubelet commands
Check logs of the container
Create multiple containers in a POD
Kubernetes Annotations
Variables in the YAML file
Defining Ports
Section 5: Kubernetes Pod Restart Policy
Overview of Pod Restart Policies
Three restart policies: Always, OnFailure & Never
Lab - Create a pod definition with ‘restartPolicy’ as Always
Lab - Create a pod definition with ‘restartPolicy’ as OnFailure
Lab - Change the pod definition a bit to check the working of OnFailure
Lab - 4. Create a pod definition with ‘restartPolicy’ as Never
Section 6: Labels & Selectors
Labels & Selectors
Commands for managing labels & selectors
Declarative vs. Imperative Kubernetes commands
Two types Selectors
Equality Based
Set based
Practice Lab - Labels & Selectors
Practice Lab - Assign a label to the running POD
Practice Lab - Search the pod with equality & set-based
Node Selector
Lab - Create a pod on a specific node
Section 7: Scaling & Replication
What is ReplicationController?
Features of RC
Practice Lab - Create Replicas of POD using RC
Practice Lab - Recreate the POD, if it crashes, fails, or terminated
Scale up & scale down the POD as the load increases
Practice Lab - Scale up & scale down the POD
What is ReplicaSet?
Difference between ReplicationController & ReplicaSet
Practice Lab - Create Replicas of POD using ReplicaSet
Practice Lab - Use set-based match expressions in RS
Section 8: Deployment & Rollback
Overview of Deployment and Rollback
Manifest for a POD with one container using the deployment object.
Lab: Launch an application with two PODs using the deployment object.
Lab: Using the deployment object, upgrade an application from version 1 to version 2.
Lab: Roll back the application to the previous version.
Lab: Roll back the application to any specific version.
Section 9: Kubernetes Networking
Overview of Kubernetes Networking
Container communication via localhost
Practice Lab - container-to-container communication on specific port within a pod
Pod-to-pod communication
Practice Lab - Pod-to-pod communication
Object - Service
Why service is required?
Service type
Cluster IP
NodePort
LoadBalancer
Headless
Practice Lab - Access the appl/service using cluster IP within the cluster using the service object
Practice Lab - Access the appl/service using NodePort outside the cluster using the service object
Section 10: Volumes in Kubernetes Cluster
Overview of Volumes in Kubernetes Cluster.
Volume types
EmptyDir
hostpath
Practice Lab: Create a POD with attached volume using volumes.
Practice Lab - Attach a shareable volume for containers within a POD.
Practice Lab - Attach a shareable volume for containers within a POD as well as with the host or worker node.
Practice Lab - EmptyDir
Practice Lab - hostpath
Section 11: Persistent Volumes
Overview of Persistent volumes
PersistentVolumeClaim - PVC
Configure a Volume using AWS ElasticBlockStore
Configure a Pod to Use a PersistentVolume for Storage
Practice Lab - Create a PersistentVolume
Practice Lab - Create a PersistentVolumeClaim
Practice Lab - Create a Pod to Use a PersistentVolume for Storage
Section 12: Namespaces in Kubernetes
Overview of Namespaces
Lab - Create new namespaces
Lab - Create Pod and Service in Namespaces
Lab - Switch between Kubernetes namespaces
Lab - Create pods in the namespace.
Lab - delete a Kubernetes namespace
Section 13: Resource Management for Pods and Containers
Overview of resource management for pods, containers
Lab resource-based quota
Lab - Apply pod quotas to namespaces
Requests and Limits
Lab - Set requests and limits in each container running in a pod.
Lab - Apply quotas to namespaces
Lab - Create pods with resources in namespaces
Section 14: Kubernetes HPA - Horizontal Pod Autoscaler
Kubernetes autoscaling basics
Lab: Configuring Minikube Cluster
Lab: Installation of Metric Server
Lab: Creating pods using deployment objects
Lab: Configure HPA - Horizontal Pod Autoscaler
Lab: A new pod is created automatically if the CPU load reaches a threshold value
Lab: A new pod is automatically terminated if the CPU load falls below the threshold value
Section 15: Kubernetes Jobs, Init container
Overview of Jobs and cron job pattern
Lab: Create a Pod Using Job Object
Lab: Run Multiple Pods in Parallel Using Job Object
Lab: Create jobs on a repeating schedule using CronJob
About Init Container and their use cases
Lab: Init Container
Section 16: Introduction to docker containers
Introduction about containers
Installation of Docker
Create a first container
Fetch container image from docker hub
Run a container in the background, interactive with tty terminal
Delete exited dockers using a single command
Get complete details of a running container
Check logs & stats of a running container
Port forwarding
exec, rename & restart the running container
Attach a container
Kill/stop, pause/unpause a container
Create, start, the cp command
Export/Import Command in Docker
Create an image from a running container
Pull a specific version image from the Docker hub
Image history, inspect & remove the image
Section 17: Dockerfile
Overview of Dockerfile, layered architecture
Create centos 7 images using Dockerfile
Overview of LABEL, ENV & RUN Command
Overview of WORKDIR
Copy, and add commands with their differences
Create a user account with a password using dockerfile
CMD Command
SSH to a container
Overview of EXPOSE Command
ENTRYPOINT in Dockerfile
Section 18: Manage Data in Docker
Overview of managing data in Docker
Volumes
Create & attach a volume to a container
Delete volumes from the Docker host machine
Bind mounts
Section 19: Networking in Docker
Bridge networking
Run containers in custom-created bridge networking
Enable communication between dockers belonging to different bridge network
DNS enabled with custom bridge networking
Host networking
None networking
Connect one or more networks to a running container
Create a private docker registry
How to allow images in the private registry for non-secure network
Section 20: Docker Compose
Overview of docker-compose
Docker compose Installation
Create my first docker-compose file
Create the docker-compose file in JSON language
Learn basic commands
docker-compose up
docker-compose down
docker-compose create
docker-compose start
docker-compose stop
docker-compose rm
docker-compose images
docker-compose ps
docker-compose pause
docker-compose unpause
docker-compose kill
docker-compose port <servername> port
docker-compose logs
docker-compose exec
docker-compose run
docker-compose scale
docker-compose top
Attach a volume & port mapping using docker-compose
Build a custom image using docker-compose
Section 21: Real-time project - Deploy an application to a Kubernetes cluster using Jenkins CI/CD pipeline, Ansible, Docker, Git, Webhook etc.