Journeys · Kubernetes · L0
From kubectl apply to a Running Pod
One command. Eleven components. Watch every one of them.
✓ Validated on v1.37.2 · validation Run 1 · 2026-11-18Preview
The 30-second answer
kubectl hands your wish to the API server. The API server checks it and writes it into etcd, the cluster's memory. Helpers who are always watching notice the new wish: one makes a ReplicaSet, the next makes a Pod, the scheduler picks a machine for it, and the kubelet on that machine starts it. When the app answers its health check, the Pod is Ready for visitors.
Mental model
Think of a restaurant with one order window and a big notice board. You hand your order to the window (the API server). It checks the order and pins it on the board (etcd). Nobody shouts instructions. Each cook watches the board for the kind of ticket they handle, does their bit, and pins up a new ticket for the next cook.
Where the analogy breaks
In a real kitchen, cooks talk to each other. In Kubernetes they never do. The scheduler never calls the kubelet. The Deployment controller never calls the ReplicaSet controller. Every hand-off is a write to the API server that the next helper happens to be watching. That is why one slow helper never blocks the others, and why "who is responsible?" is always answered by "who watches this kind of object?".
Press play and watch the story unfold.
Event stream
Click a row to inspect it| # | Time | From → To | Kind | What |
|---|---|---|---|---|
| Press play. Each hand-off appears here, like a packet capture. | ||||
Predict, then check
You delete the Pod. Do you get the same Pod back?
No. On the validation cluster, deleting web-6695c967bd-pqf68 gave a replacement called web-6695c967bd-56nvn, with a new UID and the IP 10.244.0.23 instead of 10.244.0.15. Pods are replaced, never restarted.
The API server goes down for 30 seconds while the Pod is running. Does the app stop?
No. The kubelet and the container keep running. You cannot change anything until the API server is back, and status updates wait.
Your Pod stays Pending for minutes. Where do you look first?
At the scheduler's FailedScheduling event in kubectl describe pod. It says why each machine was rejected.
Transcript
The whole journey as text, for reading, searching and screen readers.
kubectl gets ready
kubectl reads your YAML. From ~/.kube/config it learns where the cluster is and which certificate proves who you are. It also downloads the cluster's API description (OpenAPI), so it knows exactly what a Deployment in apps/v1 is allowed to contain.
Insight: kubectl is an ordinary HTTPS client. Add -v=8 to any command and you can read every request it sends.
kubectl→kube-apiserver: GET /openapi/v3 → 200 OKkubectl→kube-apiserver: GET /openapi/v3/apis/apps/v1 → 200 OK
Does it exist yet?
kubectl apply first asks: is there already a Deployment called web? The answer is 404 Not Found. It checks that the namespace shop exists. Then it sends a create (POST). Inside the object it tucks a note, the last-applied-configuration annotation, holding exactly what you applied. Next time you apply, it compares against that note to work out what you removed.
Insight: This is client-side apply, still kubectl's default in v1.37. With --server-side the API server does this bookkeeping instead, and records who owns each field.
kubectl→kube-apiserver: GET /apis/apps/v1/namespaces/shop/deployments/web → 404kubectl→kube-apiserver: GET /api/v1/namespaces/shop → 200 OKkubectl→kube-apiserver: POST /apis/apps/v1/namespaces/shop/deployments
The API server's checkpoint
Before anything is saved, the request goes through the same checkpoint every time. Who are you? Your certificate says kubernetes-admin, in the group kubeadm:cluster-admins. Are you allowed to create Deployments here? RBAC says yes. Missing fields get their default values, admission plugins get a chance to change or reject the request, and the result is checked against the schema. Only then is it written down.
Insight: If any check says no, nothing is saved, so there is nothing to describe later. The error kubectl printed is the whole story.
kube-apiserver→kube-apiserver: authenticate → authorize (RBAC) → defaults → admission → validate
Written into the cluster's memory
The API server writes the Deployment into etcd under the key /registry/deployments/shop/web. The value is not YAML. It starts with the four bytes k8s and a zero, followed by a compact binary format called protobuf. etcd gives the write a revision number, and that number becomes the object's resourceVersion.
Insight: Only the API server talks to etcd. Whoever can read etcd can read every Secret in the cluster, in plain text unless encryption at rest is turned on.
kube-apiserver→etcd: put /registry/deployments/shop/web (revision 1882)kube-apiserver→kubectl: 201 Created → kubectl prints: deployment.apps/web created
The Deployment controller notices
Inside kube-controller-manager, the Deployment controller is always watching Deployments. It hears ADDED for web, finds no ReplicaSet for this Pod template, and creates one called web-6695c967bd. Those ten characters are a hash of the Pod template. Change the template and you get a new hash, a new ReplicaSet, and that is how rollouts work.
Insight: A Deployment never manages Pods directly. It manages ReplicaSets, one per version of your template, which is what makes rolling back possible.
kube-apiserver→controller-manager: WATCH ADDED Deployment shop/webcontroller-manager→kube-apiserver: POST /apis/apps/v1/namespaces/shop/replicasetscontroller-manager→kube-apiserver: Event ScalingReplicaSet
The ReplicaSet controller makes a Pod
The ReplicaSet controller counts Pods that match its selector. It wants one and has none, so it creates a Pod from the template. The API server adds five random characters to the name: web-6695c967bd-qc9kz. The Pod is saved with no machine chosen yet, so its phase is Pending.
Insight: Pending for a moment is normal: it only means 'not on a machine yet'. Pending for minutes is a problem, and incident S1.1 shows how to read why.
kube-apiserver→controller-manager: WATCH ADDED ReplicaSet shop/web-6695c967bdcontroller-manager→kube-apiserver: POST /api/v1/namespaces/shop/podscontroller-manager→kube-apiserver: Event SuccessfulCreatecontroller-manager→kube-apiserver: PUT …/deployments/web/status → 409 Conflict
The scheduler picks a machine
The scheduler watches for Pods with no machine. It throws out machines that cannot run this Pod, ranks the rest, and picks the best. The Pod asks for 100m of CPU and 128Mi of memory, and explorer-worker2 has room, so it wins. The scheduler starts nothing itself. It writes down one fact, called a binding: this Pod belongs on explorer-worker2.
Insight: The scheduler compares requests with what the machine has left to give, not with how busy it really is, and never with limits.
kube-apiserver→kube-scheduler: WATCH ADDED Pod shop/web-6695c967bd-qc9kz (no node yet)kube-scheduler→kube-apiserver: POST …/pods/web-6695c967bd-qc9kz/binding → explorer-worker2kube-scheduler→kube-apiserver: Event Scheduled
The kubelet on explorer-worker2 notices
Each kubelet watches only the Pods whose nodeName is its own machine. The binding has set that field, so the kubelet on explorer-worker2 picks the Pod up. It checks there is room, then creates a cgroup for the Pod. A Pod with requests but no limits is Burstable, so its cgroup lives under /kubepods/burstable.
Insight: Nobody told the kubelet about this Pod. It found it by watching for its own name.
kube-apiserver→kubelet: WATCH Pod (spec.nodeName=explorer-worker2)kubelet→kube-apiserver: POST …/serviceaccounts/default/token → 201
A home for the Pod, and an address
The kubelet asks containerd, over a gRPC interface called CRI, to make a Pod sandbox. containerd starts a tiny pause container whose only job is to hold the Pod's namespaces open, including its own network namespace. Then containerd calls the CNI plugin with ADD. The plugin wires a cable from the Pod to the machine and its IPAM hands out an address from this machine's range: 10.244.0.28. Every container in the Pod shares that address.
Insight: The container runtime, not the kubelet and not kube-proxy, calls CNI. And CNI's IPAM, not kube-proxy, hands out Pod IPs.
kubelet→containerd: CRI RunPodSandboxcontainerd→CNI plugin: CNI ADD → 10.244.0.28
Download, create, start
The image is not on this machine yet, so the kubelet asks containerd to pull it. On the validation cluster that took 5.019 seconds for 72 MB, most of the whole journey. Then the kubelet asks containerd to create the container and start it. The phase is now Running.
Insight: Running means the process started. It says nothing about whether the app can answer yet. The next step proves it.
kubelet→containerd: CRI PullImage nginxinc/nginx-unprivileged:1.27containerd→Registry: Download image layers from the registrykubelet→containerd: CRI CreateContainer, StartContainerkubelet→kube-apiserver: Events Pulling, Pulled, Created, Started
Is it really ready?
The kubelet now knocks on the app's door: an HTTP GET to / on port 8080. On the validation cluster, the very first knock failed. nginx had started but was not listening yet: connection refused. Kubernetes did not panic. It kept the Pod out of traffic, knocked again, got an answer, and only then marked the Pod Ready. If a Service selects this Pod, its address is now listed as ready and kube-proxy on every machine updates its rules.
Insight: This is readiness doing its job. Without a readiness probe, the Pod would have been sent traffic during that moment when nginx could not answer.
kubelet→kube-apiserver: Event Unhealthy: first readiness check refusedkubelet→kube-apiserver: PATCH …/pods/web-6695c967bd-qc9kz/status → Ready=True
Done, and still watching
The Deployment controller sees one available replica and updates the Deployment's status. kubectl rollout status prints: deployment "web" successfully rolled out. But nothing really stops. Every helper keeps watching. Delete the Pod, lose the machine, or change the image, and the same chain runs again.
Insight: Kubernetes is not a script that runs once. It is a set of loops that never stop comparing what you asked for with what is real.
controller-manager→kube-apiserver: Deployment status: 1 available (resourceVersion now 1911)