

Lesson 01 · 12 min
What Kubernetes solves: cluster, control plane, nodes and kubectl
You describe the desired state in YAML, and the cluster brings reality in line with it.
12 minLesson 1 of 5Practice includedAsk AI on any point
Docker can run a container on one machine. But production has many machines, containers crash, servers reboot, traffic grows in the evening and drops at night. Something has to decide where to run a container, restart it after a crash, spread the traffic and roll out a new version without downtime. That is the job of an orchestrator, and Kubernetes (k8s for short) became the standard one.
What exactly Kubernetes takes care of
- Scheduling: picks a node with enough CPU and memory for the container.
- Self healing: a container crashed or a node disappeared, and Kubernetes starts a replacement elsewhere.
- Scaling: 3 copies of the app become 10 with one command or automatically.
- Networking and load balancing: a stable address for a group of containers that keep changing.
- Zero downtime updates: a new version rolls out gradually, and the old one can be restored.
- Configuration and secrets: settings live separately from the image.
Cluster: control plane and nodes
A cluster has two parts. The control plane is the brain: it accepts commands, stores state and decides what should run where. Nodes (worker nodes) are the hands: ordinary virtual or physical machines where containers actually run.
- kube-apiserver: the single entry point to the cluster. kubectl, controllers and nodes talk only to it.
- etcd: a key value store holding the whole cluster state. Lose etcd without a backup and you lose the cluster.
- kube-scheduler: picks a node for every new Pod.
- kube-controller-manager: a set of controllers that keep comparing the desired state with the actual one in a loop and fix the difference.
- On every node: kubelet (the agent that runs containers and reports on them), kube-proxy (network rules for Services) and a container runtime.
The declarative approach
The core idea of Kubernetes: you do not say "start three containers", you say "I want three copies of this image running at all times". That is the desired state. Controllers keep comparing it with the actual state and fix the difference. This cycle is called the reconciliation loop. The desired state is written in YAML manifests and kept in git next to the code.
Every object has four required parts: apiVersion (the API version the type lives in), kind (the object type), metadata (name, namespace, labels) and spec (what you want). Kubernetes also adds status: what actually exists.
kubectl: how to talk to the cluster
Check
Lock it in before you move on
1. Where does Kubernetes store the state of the whole cluster?
2. What does the declarative approach mean in Kubernetes?
3. Which component runs containers on a specific node?
4. How is kubectl apply different from kubectl create?
- Kubernetes in the knowledge base
- Kubernetes or Docker: what gets compared and when to pick which
- Docker basics course: images and containers