2/445 min
Foundation
Why Kubernetes Exists
The problem Kubernetes solves and why it matters.
beginner45 minRead β Lab β Quiz β Practice
π§ Brain Warm-Up
π§ Brain Warm-Up: Imagine you run a web app inside a single Docker container on a bare virtual machine. If the container crashes in the middle of the night, what happens? How would you automatically detect it and restart it? Think about this operational headache before reading below.
The Problem
Before Kubernetes, running containers at scale meant manually managing dozens or hundreds of servers. If a container crashed, you had to notice it via alerts and restart it manually. Scaling meant SSHing into servers, running docker run commands, and updating load balancer configs. Rolling updates meant downtime.
Kubernetes is a container orchestration platform that automates these operational tasks:
- Self-healing β crashed containers are restarted automatically; failed nodes are evacuated
- Scaling β scale from 1 to 1000 replicas with a single command or automatically based on CPU
- Rolling updates β deploy new code versions sequentially with zero downtime
- Service discovery β containers find and communicate with each other automatically
- Resource management β pack workloads efficiently across physical nodes to save hosting costs
Container Infrastructure Evolution
Traditional Deploy Containerized (Docker) Orchestrated (Kubernetes) βββββββββββββββββ βββββββββββββββββββββββ βββββββββββββββββββββββββ β Web App β β βββββββββ βββββββββ β β βββββββββ βββββββββββ β βββββββββββββββββ β β App 1 β β App 2 β β β β Pod 1 β β Service β β β Host OS β β βββββββββ΄ββΌββββββββ€ β β βββββββββ΄ββ΄ββββββββββ€ β βββββββββββββββββ β β Docker Engine β β β β Worker Node β β β Hypervisor/VM β β βββββββββββββββββββββ€ β β βββββββββββββββββββββ€ β βββββββββββββββββ β β Host OS β β β β Control Plane β β β Hardware β β βββββββββββββββββββββ β β βββββββββββββββββββββ β βββββββββββββββββ βββββββββββββββββββββββ βββββββββββββββββββββββββ Manual scaling, Port conflicts, no Automated scheduling, long boot times built-in self-healing self-healing, routing
The Mental Model
Think of Kubernetes like a shipping company:
- The Control Plane is the company headquarters β it makes all decisions and schedules work.
- Worker Nodes are the cargo ships β they have physical capacity (CPU/RAM) and run the containers.
- Pods are the shipping containers β the basic atomic unit of transport in the cluster.
- kubectl is your satellite radio β the CLI tool you use to send declarative instructions to HQ.