Orchestration

Kubernetes Orchestration: The Captain of the Container Ship

Updated June 2026
Server Cluster Racks Networking Setup
Kubernetes coordinates, manages, and scales thousands of Docker containers across a server cluster automatically.

Docker is a fantastic tool for creating and running containerized boxes on your computer. But what happens when tech giants like Spotify, Netflix, or BookMyShow need to run thousands of containers simultaneously across hundreds of cloud servers? Managing them manually, checking if they crash, and connecting them to the network becomes a logistical nightmare.

This is why we use Kubernetes (often called K8s). It acts as the ultimate automated supervisor for all your containers.

The Cargo Ship Captain Metaphor

If a single Docker container is a standardized metal shipping box, then a large web application is a massive cargo ship loaded with 10,000 boxes. If boxes are loaded incorrectly, the ship will tip over. If a box starts leaking or falls off, the cargo is lost. You need a captain to supervise everything.

Kubernetes is the Cargo Ship Captain. K8s coordinates where to stack containers based on server capacity (RAM and CPU), monitors if containers crash and restarts them, and acts as a harbor master directing network traffic so everything moves smoothly.

Real-World Example: Hotstar During an IPL Cricket Match

Imagine Hotstar is streaming an IPL cricket final. On a normal weekday morning, only 1,000 users are active, so Hotstar runs its application on just 5 container instances to save cloud hosting costs.

Suddenly, the match starts and 1 crore (10 million) fans log in simultaneously to stream the game. The 5 containers immediately get overloaded and will crash. Hotstar engineers don't have time to manually buy new servers or start containers one by one.

The Kubernetes Solution: Kubernetes detects that container CPU usage is spiking past 80%. It automatically spins up 5,000 new streaming container replicas across dozens of cloud servers in seconds. Once the match finishes and fans log off, Kubernetes automatically scales down and deletes the extra containers to save money. That is K8s automation!

The Core Vocabulary of Kubernetes

Kubernetes uses specific names for its parts. Let's break down the core hierarchy from the smallest unit to the largest system:

Pod

The smallest deployable unit in K8s. A Pod is a wrapper (like a peanut shell) that holds your running Docker container (the peanut).

Node

A single worker computer or virtual machine (like an AWS EC2 instance) that physically hosts and runs the Pods.

Cluster

The brain. A collection of multiple Nodes controlled by a master control plane working together as a single supercomputer.

Deployment

The manager. You tell the deployment: "Keep 3 copies of my app running." If a server dies, the deployment immediately spawns a replacement.

7 Everyday kubectl Commands Every Engineer Needs

To control Kubernetes, you use a CLI tool called kubectl (pronounced "cube control"). Here is the cheat sheet of the 7 commands you will use daily:

Purpose kubectl Command Real-World Analogy & Example
List Running Pods kubectl get pods Lists all active app containers and shows if they are healthy or crashing.
Example: kubectl get pods (Shows names, status, and restarts).
List Server Nodes kubectl get nodes Lists all the physical/virtual computer servers linked to the cluster.
Example: kubectl get nodes
Deploy/Modify Apps kubectl apply -f <file.yaml> Feeds a YAML configuration blueprint to the cluster to create or update resources.
Example: kubectl apply -f deployment.yaml
Delete Resources kubectl delete -f <file.yaml> Deletes deployed resources described in the YAML file from the cluster.
Example: kubectl delete -f deployment.yaml
View Application Logs kubectl logs <pod-name> Displays stdout logs from your app container to debug errors or warnings.
Example: kubectl logs my-web-pod-a1b2
Describe Resource Details kubectl describe pod <pod-name> Prints detailed metadata, events, and configuration errors for troubleshooting.
Example: kubectl describe pod my-web-pod-a1b2
Scale Manually kubectl scale --replicas=<N> deploy/<name> Tells K8s to immediately spin up or scale down your app to exactly N copies.
Example: kubectl scale --replicas=10 deployment/my-api

Pro-Tip: Pod Self-Healing

In Kubernetes, never restart a pod manually! If you delete a crashing pod using kubectl delete pod <name>, the supervising Deployment will instantly spawn a brand new pod with a fresh IP address to replace it. K8s is self-healing!

Next Steps on Your DevOps Journey

Now that you can run containerized clusters at scale using Kubernetes, you run into another DevOps roadblock: How do we write down all these server networks, K8s clusters, and databases as reusable code blueprints rather than clicking buttons on cloud dashboards? Enter Terraform (Infrastructure as Code)!

Test Your Knowledge

Answer these 25 questions to check your understanding of this module. Click on an option to reveal the correct answer instantly.

Question 1 of 25
What is a Pod?
A. A virtual machine
B. The smallest deployable unit
C. A node
D. A cluster
Explanation: A Pod is the smallest and simplest Kubernetes object.
Question 2 of 25
Which tool is the CLI for Kubernetes?
A. kubecmd
B. kubectl
C. k8s-cli
D. kubeadm
Explanation: kubectl is the command line tool for communicating with the cluster.
Question 3 of 25
What manages the state of the cluster?
A. etcd
B. scheduler
C. controller-manager
D. kubelet
Explanation: etcd is a consistent and highly-available key value store for cluster data.
Question 4 of 25
What component runs on every node and starts pods?
A. kube-proxy
B. kubelet
C. api-server
D. etcd
Explanation: The kubelet ensures that containers are running in a Pod.
Question 5 of 25
What resource ensures a specified number of pod replicas are running?
A. Pod
B. Service
C. ReplicaSet (or Deployment)
D. Ingress
Explanation: A ReplicaSet ensures that a specified number of pod replicas are running.
Question 6 of 25
Which service type exposes the service on each Node’s IP?
A. ClusterIP
B. NodePort
C. LoadBalancer
D. ExternalName
Explanation: NodePort exposes the Service on the same port of each selected Node.
Question 7 of 25
What is a Namespace?
A. A physical server
B. A virtual cluster
C. A network rule
D. A storage type
Explanation: Namespaces provide a mechanism for isolating groups of resources.
Question 8 of 25
What is used to define Kubernetes objects?
A. JSON/YAML
B. HTML
C. XML
D. Java
Explanation: K8s resources are typically defined in YAML or JSON files.
Question 9 of 25
How do you list all pods?
A. kubectl list pods
B. kubectl get pods
C. kubectl show pods
D. kubectl view pods
Explanation: kubectl get pods lists all pods in the namespace.
Question 10 of 25
What is a ConfigMap?
A. A map of the network
B. Object to store non-confidential data
C. A secret storage
D. A mapping of ports
Explanation: ConfigMaps store non-confidential data in key-value pairs.
Question 11 of 25
What is a Secret?
A. Hidden pod
B. Object to store sensitive data
C. Private network
D. Hidden log
Explanation: Secrets are used to store sensitive information like passwords or keys.
Question 12 of 25
What is a DaemonSet?
A. Runs a copy of a pod on all nodes
B. Runs a background process
C. Manages database
D. Manages networking
Explanation: A DaemonSet ensures that all (or some) Nodes run a copy of a Pod.
Question 13 of 25
What does "kubectl apply -f" do?
A. Deletes resources
B. Creates/Updates resources from a file
C. Formats a file
D. Filters output
Explanation: It applies a configuration change to a resource from a file.
Question 14 of 25
What is an Ingress?
A. A firewall
B. Internal load balancer
C. Manages external access to services (HTTP/S)
D. A database connector
Explanation: Ingress exposes HTTP and HTTPS routes from outside the cluster to services.
Question 15 of 25
What is a StatefulSet used for?
A. Stateless apps
B. Stateful apps (like databases)
C. Batch jobs
D. One-time tasks
Explanation: StatefulSet manages stateful applications with stable identities.
Question 16 of 25
What is a PersistentVolume?
A. RAM storage
B. Storage that survives pod restart
C. Temporary cache
D. Network bandwidth
Explanation: PV is a piece of storage in the cluster that has a lifecycle independent of any Pod.
Question 17 of 25
How do you check logs of a pod?
A. kubectl logs
B. kubectl read
C. kubectl cat
D. kubectl monitor
Explanation: kubectl logs prints the logs for a container in a pod.
Question 18 of 25
What is a Liveness Probe?
A. Checks if pod is ready to accept traffic
B. Checks if container is running
C. Checks if node is alive
D. Checks network speed
Explanation: It checks if the container is running; if it fails, K8s restarts the container.
Question 19 of 25
What is a Readiness Probe?
A. Checks if pod is ready to accept traffic
B. Checks if container is alive
C. Checks disk space
D. Checks CPU
Explanation: It determines if a container is ready to accept service requests.
Question 20 of 25
What is "Minikube"?
A. A small pod
B. A tool to run K8s locally
C. A minimal container
D. A reduced kubectl
Explanation: Minikube implements a local Kubernetes cluster.
Question 21 of 25
What is a Job in K8s?
A. A background service
B. A scheduled task that runs to completion
C. A recruitment post
D. A network task
Explanation: A Job creates one or more Pods and ensures that a specified number of them successfully terminate.
Question 22 of 25
What is a CronJob?
A. A time-based job scheduler
B. A continuous service
C. A database backup
D. A monitoring tool
Explanation: A CronJob creates Jobs on a repeating schedule.
Question 23 of 25
How do you enter a shell inside a pod?
A. kubectl ssh
B. kubectl exec -it
C. kubectl enter
D. kubectl shell
Explanation: kubectl exec -it -- /bin/bash allows interactive shell access.
Question 24 of 25
What is Helm?
A. A dashboard
B. A package manager for Kubernetes
C. A monitoring tool
D. A network plugin
Explanation: Helm helps you manage Kubernetes applications.
Question 25 of 25
What component schedules pods to nodes?
A. kube-scheduler
B. kube-controller
C. etcd
D. api-server
Explanation: kube-scheduler watches for newly created Pods and selects a node for them.