← writing

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.

Components around the API server kubectl, the scheduler, the controllers, the cloud controller manager and every kubelet talk to kube-apiserver. Only kube-apiserver talks to etcd. control plane worker node etcd API server only kube-apiserver the only door kubectl you, and tools scheduler picks a node controllers reconcile state cloud controller cloud only kubelet one per node every arrow: watch the API server, then write the result back
Everything talks to the API server, and only the API server talks to etcd.

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

the worker node

What runs on a worker node The kubelet gets its pods from the API server, starts them through the container runtime, and the runtime calls the network plugin for an IP address. kube-proxy gets Services and EndpointSlices from the API server and programs packet rules. kube-apiserver worker node kubelet node agent runtime containerd, CRI-O containers network plugin CNI kube-proxy Service rules packet rules iptables, nftables CRI calls programs pods for this node Services and EndpointSlices
The kubelet drives the runtime, and the runtime calls the network plugin. kube-proxy only writes packet rules.

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.

One Deployment, step by step Seven steps. kubectl writes a Deployment. The Deployment controller writes a ReplicaSet. The ReplicaSet controller writes three Pods. The scheduler sets a node on each Pod. The kubelet starts the containers and reports status. The kubelet reports the Pod ready. The EndpointSlice controller marks the pods ready in the Service's EndpointSlice. 1 kubectlyour terminal Deployment webstored after auth, RBAC, admission, validation this write wakes the next component 2 Deployment controllerkube-controller-manager ReplicaSet for the Deploymentwants 3 pods, has 0 wakes 3 ReplicaSet controllerkube-controller-manager 3 Pod objectsno node yet, status Pending wakes 4 schedulerkube-scheduler a node name on each Podfilter, score, bind; still Pending wakes 5 kubeleton the chosen node kubectl shows ContainerCreating, Runningimage pulled, containers up, IP from the CNI wakes 6 kubeletruns the readiness probe Pod condition: Readythe probe passed wakes 7 EndpointSlice controllerif a Service selects it pod marked ready in the EndpointSlicekube-proxy on every node updates its rules
One Deployment, from apply to traffic. Each box on the right is a write to the API server.

The same steps in words:

  1. kubectl sends the Deployment to the API server. It is authenticated, checked against RBAC, run through admission, validated, and written to etcd.
  2. The Deployment controller sees a Deployment with no ReplicaSet and creates one.
  3. 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.
  4. The scheduler sees pods without a node, filters and scores the nodes, and binds each pod to one.
  5. 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.
  6. The kubelet reports status back. When the readiness probe passes, the pod is marked Ready.
  7. 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.

symptomstep that failedwhere to look
Pending for a long time4, schedulingkubectl describe pod. The event says why: not enough CPU or memory, an untolerated taint, an unbound volume.
ContainerCreating for a long time5, kubelet, runtime or CNIThe pod's events: image pull errors, network plugin errors.
ImagePullBackOff5, the runtime cannot fetch the imageThe image name and tag, and the registry credentials.
CrashLoopBackOffafter 5, your container started and exitedkubectl logs --previous
kubectl hangs or times out1, API server or etcdAPI server and etcd health.
node NotReadythe kubelet stopped reportingThe kubelet service and its logs on that node.
Service has no ready endpoints6 and 7, readiness or selectorkubectl 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:

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.