Most people learn Kubernetes from the outside in. You write a YAML file, run kubectl apply, and a few seconds later your app is running. It feels like magic. But under that one command there is a small set of components, each with one clear job, talking to each other through a single API.
This guide opens the box. We will look at every major piece of a Kubernetes cluster, what it does, and how the pieces work together. Then we will follow a single Deployment from your terminal all the way to a running container on a node. By the end you should be able to picture what is happening inside your cluster when you type a command, and know where to look when something goes wrong.
The big idea: desired state and reconciliation
Before looking at components, it helps to understand the one idea that drives all of Kubernetes. You do not tell Kubernetes what to do. You tell it what you want, and it keeps working until reality matches.
Every Kubernetes object has two parts. The spec is the desired state you wrote, for example “3 replicas of this image”. The status is the current state that Kubernetes observed, for example “2 replicas are ready”. Small programs called controllers watch these objects in a loop. Each loop does the same three things:
- Read the desired state (spec).
- Look at the current state (status and the real world).
- Take one step to move the current state closer to the desired state.
This pattern is called reconciliation. It is why Kubernetes heals itself. If a node dies and a Pod disappears, nobody has to run a script. A controller notices that 2 is less than 3 and creates a new Pod. Keep this loop in mind; almost every component below is some version of it.
The cluster at a glance
A Kubernetes cluster has two kinds of machines:
- The control plane makes decisions for the cluster. It stores state, schedules work, and runs the controllers. It is made of
kube-apiserver,etcd,kube-scheduler,kube-controller-managerand, on cloud providers,cloud-controller-manager. - Worker nodes run your workloads. Each node runs a
kubelet, a container runtime such as containerd or CRI-O, and usuallykube-proxy.
On top of these there are add-ons that most clusters need, such as a CNI network plugin (Cilium, Calico and others) and cluster DNS (usually CoreDNS).
One rule makes the whole design easy to reason about: every component talks to the API server, and only the API server talks to etcd. The scheduler does not call the kubelet. The controllers do not call the scheduler. They all read and write objects through the API, and they react to changes they see there.
kube-apiserver: the front door
The API server is the center of the cluster. kubectl, the dashboard, CI pipelines, controllers, the scheduler and every kubelet all use the same REST API. When a request arrives, it goes through a fixed pipeline:
- Authentication. Who are you? This can be a client certificate, a bearer token, a ServiceAccount token or an OIDC token.
- Authorization. Are you allowed to do this? Most clusters use RBAC, which checks Roles and ClusterRoles bound to your user or group.
- Mutating admission. Admission plugins and mutating webhooks can change the object, for example to add default values or inject a sidecar.
- Schema validation. The object is checked against the API schema for its kind.
- Validating admission. Validating webhooks and policies (such as ValidatingAdmissionPolicy) can reject the object, but not change it.
- Persistence. The object is written to etcd, and the API server returns a response.
The API server is stateless. You can run several copies behind a load balancer for high availability, because all real state lives in etcd. If you want to harden this layer, see our guide on how to secure your Kubernetes API server.
Watches: how everyone stays in sync
The API server does more than answer requests. Clients can open a watch on a type of object and receive a stream of events (added, modified, deleted) as they happen. Every object carries a resourceVersion, so a client that reconnects can say “send me everything after version X”. This is how the scheduler hears about new Pods and how a kubelet hears that a Pod was assigned to it, without polling the API every second.
Most components use a client-side cache built on top of watches (called an informer in client-go). They read from the local cache and only write back to the API server when they need to change something. This keeps the load on the API server and etcd low, even in large clusters.
etcd: the source of truth
etcd is a consistent, distributed key-value store. Every Kubernetes object you create, from Pods to Secrets to ConfigMaps, is stored in etcd. If you lose etcd and have no backup, you lose the cluster state.
etcd uses the Raft consensus algorithm. A cluster of etcd members elects a leader, and a write is only committed when a majority (a quorum) of members agree. That is why etcd clusters usually have an odd number of members, such as 3 or 5. A 3-member cluster can lose 1 member and keep working. A 5-member cluster can lose 2.
Two practical points follow from this. First, etcd is sensitive to disk and network latency, so it should run on fast storage. Second, you must back it up. Our step-by-step guide on etcd backup and restore walks through how to do this safely.
kube-scheduler: picking a node
The scheduler has one job: find a good node for every Pod that does not have one yet. It watches for Pods whose spec.nodeName is empty. For each one, it runs two phases:
- Filtering. Remove nodes that cannot run the Pod. A node is filtered out if it does not have enough free CPU or memory for the Pod’s requests, if it has a taint the Pod does not tolerate, if it does not match the Pod’s node selector or required node affinity, or if a needed volume cannot attach there.
- Scoring. Rank the nodes that are left. Scoring plugins look at things like spreading Pods across zones, preferred affinity rules, and how balanced resource use would be.
The scheduler picks the node with the highest score and then performs a binding: it writes the chosen node name to the Pod through the API server. That is all. The scheduler does not start containers. It only records a decision. If no node fits, the Pod stays Pending and you will see a FailedScheduling event explaining why.
Both phases are built from plugins in the scheduling framework, so you can tune behavior with scheduler profiles or even run a second scheduler for special workloads.
kube-controller-manager: the reconciliation engine
The controller manager is a single binary that runs many controllers. Each controller owns one part of the system and runs its own reconciliation loop. A few examples:
- Deployment controller: turns a Deployment into ReplicaSets and manages rolling updates between them.
- ReplicaSet controller: makes sure the right number of Pods exist for each ReplicaSet.
- Node controller: watches node health and reacts when a node stops reporting.
- Job and CronJob controllers: run Pods to completion, and create Jobs on a schedule.
- EndpointSlice controller: keeps track of which Pod IPs back each Service.
- ServiceAccount and namespace controllers: create default ServiceAccounts and clean up when a namespace is deleted.
Controllers build on each other through ownership. A Deployment owns ReplicaSets, and a ReplicaSet owns Pods. Each child has an ownerReferences field pointing at its parent. When you delete a Deployment, the garbage collector follows these references and removes the children.
If you run more than one copy of the controller manager or scheduler for high availability, only one copy is active at a time. They use leader election backed by a Lease object in the kube-system namespace. The other copies wait and take over if the leader stops renewing its lease.
On cloud providers there is also a cloud-controller-manager. It holds the cloud-specific logic, such as creating cloud load balancers for Services of type LoadBalancer and checking whether a VM behind a node still exists.
On the node: kubelet, container runtime and kube-proxy
kubelet
The kubelet is the agent on every node. It watches the API server for Pods bound to its node. When a new Pod shows up, the kubelet makes it real: it pulls images, mounts volumes, starts containers in the right order (init containers first), runs liveness, readiness and startup probes, and reports the Pod status back to the API server.
The kubelet also reports the health of the node itself. It updates a Lease object in the kube-node-lease namespace as a lightweight heartbeat, and it updates the Node status with capacity and conditions such as Ready, MemoryPressure and DiskPressure.
Container runtime and the CRI
The kubelet does not run containers itself. It talks to a container runtime through the Container Runtime Interface (CRI), a gRPC API. The common runtimes are containerd and CRI-O. Under them, a low-level OCI runtime such as runc creates the actual Linux processes with namespaces and cgroups.
For each Pod, the runtime first creates a Pod sandbox. On Linux this is a small “pause” container that holds the shared network namespace. All app containers in the Pod then join that namespace, which is why containers in the same Pod can talk to each other on localhost and share one IP address.
CNI and CSI
When the sandbox is created, the runtime calls a CNI (Container Network Interface) plugin to give the Pod an IP address and connect it to the cluster network. Storage works in a similar plug-in way: CSI (Container Storage Interface) drivers attach and mount volumes from cloud disks, SAN systems or other storage backends.
kube-proxy
kube-proxy runs on each node and implements Services. It watches Services and EndpointSlices and programs the node’s packet rules (for example with iptables or nftables on Linux) so that traffic sent to a Service IP is sent on to one of the healthy backend Pods. Some CNI plugins, such as Cilium, can replace kube-proxy entirely using eBPF.
The networking model in one page
Kubernetes networking follows a few simple rules, and the CNI plugin is responsible for making them true:
- Every Pod gets its own IP address.
- Pods can reach all other Pods in the cluster directly, without NAT.
- Agents on a node (such as the kubelet) can reach all Pods on that node.
Pods come and go, so their IPs change. A Service gives a group of Pods a stable virtual IP and DNS name. The Service selects Pods by label, the EndpointSlice controller records the matching Pod IPs, and kube-proxy (or its replacement) routes traffic to them. CoreDNS answers queries such as web.default.svc.cluster.local with the Service IP. Ingress controllers and the newer Gateway API sit on top of Services to handle traffic coming from outside the cluster.
Walkthrough: from kubectl to a running container
Now let us put it all together. Here is what happens when you run:
kubectl create deployment web --image=nginx --replicas=3
- kubectl reads your kubeconfig, builds a Deployment object and sends an HTTPS POST to the API server. (Our post kubectl Deep Dive: What Really Happens When You Press Enter covers this client side step in detail.)
- The API server authenticates you, checks RBAC, runs admission, validates the object and stores it in etcd. It replies with success. At this point nothing is running yet. Kubernetes has only recorded what you want.
- The Deployment controller sees a new Deployment through its watch. It creates a ReplicaSet with
replicas: 3and a matching Pod template. - The ReplicaSet controller sees the new ReplicaSet, counts zero matching Pods, and creates three Pod objects. These Pods have no node yet, so they are
Pending. - The scheduler sees three unscheduled Pods. For each one it filters and scores nodes, then binds the Pod by setting
spec.nodeName. - The kubelet on each chosen node sees a Pod assigned to it. It asks the container runtime over CRI to create a Pod sandbox. The runtime calls the CNI plugin, which assigns the Pod an IP.
- The runtime pulls the
nginximage if it is not cached and starts the container. - The kubelet runs any probes and updates the Pod status to
Runningand, once ready,Ready. The ReplicaSet and Deployment controllers update their own status to show 3 of 3 replicas available.
Notice that no component gave orders to another one. Each one watched the API, saw something it cared about, did its part and wrote the result back. That loose coupling is what makes Kubernetes so resilient and so easy to extend with your own controllers and operators.
Hands-on: watch the machinery yourself
Prerequisites: a working cluster (kind, minikube or any managed cluster) and kubectl configured to talk to it. Some commands below need cluster-admin rights, and on managed clusters the control plane Pods may be hidden from you.
Check the health of the API server and its dependencies, including etcd:
kubectl get --raw='/readyz?verbose'
See the control plane and add-on Pods (on kubeadm, kind and minikube clusters the control plane runs as static Pods here):
kubectl get pods -n kube-system -o wide
Create a Deployment and follow the chain of objects it creates:
kubectl create deployment web --image=nginx --replicas=3
kubectl get deployment,replicaset,pods -l app=web -o wide
Read the events. You will see the scheduler assigning Pods and the kubelet pulling images and starting containers:
kubectl get events --sort-by=.metadata.creationTimestamp
Look at the ownership chain from a Pod back to its ReplicaSet:
kubectl get pods -l app=web -o jsonpath='{.items[0].metadata.ownerReferences[0].kind}/{.items[0].metadata.ownerReferences[0].name}'
Expose the Deployment as a Service and see the EndpointSlice that tracks its Pods:
kubectl expose deployment web --port=80
kubectl get endpointslices -l kubernetes.io/service-name=web
See leader election and node heartbeats, both stored as Lease objects:
kubectl get leases -n kube-system
kubectl get leases -n kube-node-lease
Increase kubectl verbosity to see the actual API calls it makes:
kubectl get pods -v=6
Clean up when you are done:
kubectl delete service web
kubectl delete deployment web
What happens when things fail
Understanding the design also tells you how the cluster behaves on a bad day.
- A container crashes. The kubelet restarts it based on the Pod’s
restartPolicy, with an increasing back-off delay. This is theCrashLoopBackOffstatus you may have seen. - A node dies. The kubelet stops renewing its Lease. The node controller marks the node as not ready and adds a taint such as
node.kubernetes.io/unreachable. By default, Pods tolerate this taint for 300 seconds. After that they are evicted, and the ReplicaSet controller creates replacements that the scheduler places on healthy nodes. - The control plane goes down. Running Pods keep running, because the kubelet and container runtime do not need the API server to keep existing containers alive. What stops is change: no new scheduling, no scaling, no self-healing until the control plane is back.
- etcd loses quorum. The API server can no longer write state, so the cluster effectively becomes read-only or unavailable. This is why etcd sizing, monitoring and backups matter so much.
Key takeaways
- Kubernetes is built on desired state and reconciliation loops. You declare what you want, and controllers keep working until reality matches.
- The API server is the only door into the cluster and the only component that talks to etcd. Everything else watches and writes through it.
- etcd holds all cluster state and uses Raft with a quorum, so run an odd number of members and back it up.
- The scheduler only decides where a Pod should run. The kubelet on that node makes it happen through the container runtime, CNI and CSI.
- Services, EndpointSlices, kube-proxy and CoreDNS give changing Pods a stable address.
- Running workloads survive a control plane outage, but the cluster cannot change or heal itself until the control plane returns.
Sources
This guide is based on the official Kubernetes documentation: Cluster Architecture, Kubernetes Components, Kubernetes Scheduler, Controllers, Leases, Container Runtime Interface, Services, Load Balancing, and Networking, Admission Control and Kubernetes API health endpoints, plus the etcd documentation.

4 thoughts on “How Kubernetes Works: A Deep Dive Into the Control Plane, Nodes and Everything In Between”