Kubernetes Fundamentals
Docker solved packaging a single container. Kubernetes solves the harder problem that shows up once you have dozens of them: scheduling onto machines, restarting what crashes, routing traffic to whichever instance is healthy, and rolling out changes without downtime. This guide covers the cluster, control plane, Pods, Deployments, and Services — the objects that make that automation possible.
What Is Kubernetes?
Kubernetes is a system for running and managing containerized applications across a group of machines, automatically keeping them in the state you asked for.
Docker solves how to package and run one container on one machine. Kubernetes solves a different, harder problem: given hundreds of containers that need to run across dozens of machines, how do you decide where each one runs, keep them running when things fail, route traffic to them, and roll out new versions safely — all without a human manually managing every container by hand.
The core building blocks
Cluster
A set of machines (nodes) working together, managed as a single unit by Kubernetes.
Control Plane
The brain of the cluster — makes scheduling and reconciliation decisions, but doesn't run application workloads itself.
Worker Node
A machine that actually runs application Pods, managed by an agent called the kubelet.
Pod
The smallest deployable unit in Kubernetes — one or more tightly-coupled containers that share networking and storage.
Visual Learning
Watch one Kubernetes cluster handle deployment, scheduling, self-healing, scaling, rollouts, configuration, storage, traffic routing, and node failure as a single continuous system — not sixteen separate explanations.
Kubernetes Architecture Diagram
Kubernetes architecture splits every cluster into a control plane that makes decisions and worker nodes that run your application Pods, as the diagram under “What Is Kubernetes?” above shows. The control plane holds the API Server, etcd, the Scheduler, and the Controller Manager. Each worker node runs a kubelet that starts and watches the containers on that machine. The “Cluster Architecture” chapter later in this guide covers each component.
Why Orchestration Exists
Docker gave us portable, isolated processes. Kubernetes answers the next question: how do you run thousands of them reliably, at scale, across machines that will inevitably fail?
A single Docker host with a restart policy can recover a crashed container. But it can't recover from the host itself dying, can't intelligently decide which of 50 machines has room for a new container, can't roll out a new version without downtime, and can't automatically add capacity when traffic spikes. These are exactly the problems an orchestrator is built to solve.
- 01Kubernetes doesn't replace Docker — it orchestrates containers (built with Docker or any OCI-compatible tool) across a cluster of machines.
- 02The core value is automation of things a human would otherwise do by hand: scheduling, healing, scaling, rolling updates.
- 03Kubernetes is declarative — you state desired outcomes, not step-by-step instructions.
Cluster Architecture: Control Plane vs Worker Nodes
Every Kubernetes cluster splits cleanly into two halves: a control plane that decides, and worker nodes that execute.
The control plane runs a handful of specialized processes — none of which run your application code. The API Server is the front door: every request, from kubectl, from a CI pipeline, from an internal controller, goes through it and nowhere else. etcd is a distributed key-value store holding the entire cluster's desired state. The Scheduler decides which node a new Pod should run on. Controllers (collectively the Controller Manager) continuously watch for drift between desired and actual state and correct it.
API Server
The only component that talks to etcd directly. Validates and processes all REST requests, and is the single source of truth for "what does the cluster currently think should be running."
etcd
A distributed, consistent key-value store. If etcd is lost, the cluster loses all memory of its desired state — this is why etcd backups are critical in production.
Scheduler
Watches for Pods with no assigned node, filters out nodes that can't run them, scores the rest, and binds the Pod to the best candidate.
Controller Manager
Runs many independent control loops (ReplicaSet controller, node controller, endpoint controller, etc.), each watching one part of the cluster's state and reconciling it toward the desired state.
Pods, Deployments & ReplicaSets
You almost never create a Pod directly in production — you create a Deployment, and Kubernetes manages the Pods for you through a ReplicaSet.
Pod
One or more containers that are always scheduled together, share a network namespace (same IP, can talk via localhost), and share storage volumes. Most Pods run exactly one container.
ReplicaSet
Ensures a specified number of identical Pod replicas are running at all times — if one disappears, it creates a replacement.
Deployment
Manages ReplicaSets on your behalf, adding versioned rollouts and rollbacks. Changing a Deployment's Pod template creates a new ReplicaSet and gradually shifts traffic to it.
Services & Networking
Pods are ephemeral and their IPs change constantly — a Service gives applications one stable address to depend on.
A Service selects Pods by label (e.g. app: web) and maintains a continuously-updated list of their IPs, called Endpoints. Clients connect to the Service's stable ClusterIP and DNS name; Kubernetes' networking layer (kube-proxy) transparently routes that connection to one of the healthy backing Pods.
ClusterIP
The default Service type — a virtual IP reachable only from inside the cluster, used for internal service-to-service communication.
Labels & Selectors
Arbitrary key-value pairs attached to objects (e.g. Pods). Services, and much of Kubernetes, use label selectors to dynamically decide which objects they apply to.
Service Discovery
The mechanism by which one component finds another's current address — in Kubernetes this is DNS-based: every Service gets a predictable in-cluster DNS name.
Self-Healing & Scaling
Kubernetes doesn't just start your application once — it continuously watches and corrects, and can grow or shrink capacity automatically.
If a container inside a Pod crashes, the kubelet on that node restarts it in place according to the Pod's restartPolicy (the Pod object stays). If a Pod itself is lost — its node fails or it is evicted — the ReplicaSet controlling it notices the mismatch between desired count and current count, and creates a replacement, usually on a different node. If an entire node goes down, every Pod on it is eventually rescheduled elsewhere. If CPU load rises, the Horizontal Pod Autoscaler (HPA) can increase the replica count automatically, and scale back down once load subsides.
Configuration & Persistent Storage
The same container image should run in every environment — configuration differences and durable data are handled through dedicated Kubernetes objects, not baked into the image.
ConfigMap
Stores non-sensitive configuration (feature flags, URLs, log levels) as key-value pairs, injected into Pods as environment variables or mounted files.
Secret
Stores sensitive values (passwords, tokens, keys) similarly to a ConfigMap, but with values base64-encoded in the API object (encoding, not encryption; etcd stores them unencrypted unless encryption at rest is configured) and access-controlled separately via RBAC.
PersistentVolumeClaim (PVC)
A request for durable storage that a Pod can mount — its lifecycle is independent of any single Pod, so data survives Pod recreation.
Ingress & External Traffic
A Service alone gives you internal, IP-based access — Ingress adds HTTP-aware routing (hostnames, paths, TLS) for traffic coming from outside the cluster.
An Ingress resource defines rules like "requests to /api go to the app-svc Service" or "requests to admin.example.com go to the admin-svc Service." An Ingress Controller (a piece of software running in the cluster) watches these rules and configures a reverse proxy or load balancer accordingly.
- 01Kubernetes orchestrates containers across many machines, adding scheduling, self-healing, scaling and rollouts on top of what Docker alone provides.
- 02The control plane (API Server, etcd, Scheduler, Controllers) makes decisions; worker nodes actually run Pods via the kubelet.
- 03Deployments manage ReplicaSets, which manage Pods — each layer has one clear job.
- 04Services give applications a stable address despite constantly-changing Pod IPs; Ingress adds HTTP-level routing for external traffic.
- 05Configuration and secrets are injected, not baked into images; persistent storage is explicitly requested via PVCs so data outlives any single Pod.