What happens when you run kubectl apply
Rudra Narayan Panda ·
Kubernetes has a lot of parts, but they follow one rule: every component talks to the API server, and nothing else keeps state. This post follows one Deployment from kubectl apply to a running container and names the component that does each step. It is the first of two. The second covers how a request reaches the pod. Written in November 2026, when the current release is v1.37.
the one rule
The API server is the only component that reads and writes etcd. Everything else watches the API server for the objects it cares about, does its job, and writes the result back as a change to an object. Nobody calls anybody directly.
A controller compares the desired state in an object with what it sees and takes one step toward it, over and over. That is why a cluster survives a crashed controller: the restarted one reads the objects and carries on from wherever things stand.
the control plane
- kube-apiserver is the front door. A request is authenticated, authorized, passed through admission controllers, validated, and only then written to etcd. It keeps no state of its own, so you can run several behind a load balancer.
- etcd is the key-value store that holds the cluster's state. It uses the Raft consensus algorithm, so writes need a majority of members. That is why clusters run 3 or 5 members and not 2 or 4: a 4-member cluster tolerates one failure, the same as 3.
- kube-scheduler picks a node for each pod that has none. It filters out nodes that cannot run the pod (not enough CPU or memory, a taint the pod does not tolerate, an affinity rule), scores the rest, and records its choice on the pod. It does not start anything.
- kube-controller-manager is one process that runs many controllers: Deployment, ReplicaSet, Node, Job, EndpointSlice and more. Each one runs the loop above.
- cloud-controller-manager exists only on cloud clusters. It holds the cloud-specific loops, such as creating a cloud load balancer for a Service of type
LoadBalancerand noticing when the VM behind a node is gone.
the worker node
- kubelet is the agent on each node. It watches for pods assigned to its node, asks the container runtime to start them, runs their probes, and reports status back to the API server. It runs as a service on the node, not as a pod.
- container runtime is containerd or CRI-O. The kubelet talks to it through the Container Runtime Interface (CRI). It pulls images, starts containers, and calls the CNI plugin to set up each pod's network. Docker Engine is not called directly any more: dockershim was removed in v1.24.
- kube-proxy programs each node so traffic to a Service address reaches a pod. The second post covers it.
following one deployment
kubectl apply -f web.yaml # a Deployment with 3 replicas
kubectl get pods -w # watch them go Pending, then Running
kubectl describe pod <name> # its Events are the trail below
Read the diagram top to bottom. The box on the left is who acts, and the box on the right is what it writes to the API server. That write is what wakes the next component.
The same steps in words:
- kubectl sends the Deployment to the API server. It is authenticated, checked against RBAC, run through admission, validated, and written to etcd.
- The Deployment controller sees a Deployment with no ReplicaSet and creates one.
- The ReplicaSet controller sees a ReplicaSet that wants 3 pods and has none, and creates 3 Pod objects. They have no node yet, so they show as
Pending. - The scheduler sees pods without a node, filters and scores the nodes, and binds each pod to one.
- The kubelet on each chosen node sees a pod assigned to it. It asks the runtime to pull the image and start the containers. The runtime calls the network plugin (CNI) to give the pod an IP address.
- The kubelet reports status back. When the readiness probe passes, the pod is marked
Ready. - If a Service selects these pods, the EndpointSlice controller marks each pod's endpoint ready. It was listed as not ready from the moment the pod got an IP. kube-proxy on every node then updates its rules. Only now does Service traffic reach the new pods.
Each step is a write to the API server that wakes the next component. In kubectl describe pod, the Scheduled event comes from the scheduler and Pulling, Pulled, Created and Started come from the kubelet.
where it breaks
Knowing the steps tells you where to look.
| symptom | step that failed | where to look |
|---|---|---|
Pending for a long time | 4, scheduling | kubectl describe pod. The event says why: not enough CPU or memory, an untolerated taint, an unbound volume. |
ContainerCreating for a long time | 5, kubelet, runtime or CNI | The pod's events: image pull errors, network plugin errors. |
ImagePullBackOff | 5, the runtime cannot fetch the image | The image name and tag, and the registry credentials. |
CrashLoopBackOff | after 5, your container started and exited | kubectl logs --previous |
kubectl hangs or times out | 1, API server or etcd | API server and etcd health. |
node NotReady | the kubelet stopped reporting | The kubelet service and its logs on that node. |
| Service has no ready endpoints | 6 and 7, readiness or selector | kubectl get endpointslices -o yaml and look for ready: false. Then the pod labels against the selector, and the readiness probe. |
what changed recently
Three things worth knowing if your mental model is from older guides:
- In-place pod resize reached GA in v1.35. You can change the CPU and memory of a running pod without recreating it. Whether a container restarts depends on its resize policy. v1.36 added pod-level resize as beta (release post).
- Dynamic Resource Allocation reached GA in v1.34. Devices such as GPUs are requested through ResourceClaims, and the scheduler sees per-device availability, not just node totals (release post). v1.37 made its extended-resource support GA.
- v1.37 "Garhwal" is the current release, from 26 Aug 2026 (release post).
what I checked
I checked the version claims against the Kubernetes release posts linked above. I wrote this from the documentation, not from experiments on a cluster, so treat the table as a place to start looking. Details move between releases: run kubectl version and read the notes for the one you have.
Next: how a request reaches a pod.