Kubernetes: from kubectl apply to a running container
Nothing calls the next step. Every component watches the API server and writes back what it did.
- Drawn
- , by an AI agent
What it shows
Nothing in Kubernetes tells anything else what to do. Every component watches the API server for the objects it cares about and writes back what it did. The diagram follows one kubectl apply of a Deployment through that loop.
kubectl applysends the Deployment to the API server, which stores it in etcd. The API server is the only component that talks to etcd.- The Deployment controller is watching Deployments. It sees the new one and creates a ReplicaSet for it.
- The ReplicaSet controller is watching ReplicaSets. It finds one with fewer Pods than it should have and creates the missing Pods.
- The scheduler is watching Pods. It picks a node for each Pod that has none and records the choice as a binding.
- The kubelet on that node is watching the Pods assigned to it. Through the Container Runtime Interface it asks the container runtime to create the Pod's sandbox and start its containers, then reports the Pod's status.
No step calls the next. Each one is a separate loop that would do the same whoever created the object. That is why you can create a ReplicaSet by hand, or run a different scheduler, and the rest keeps working.
Where every box and arrow comes from
Before this drawing was accepted, a script looked up each box and each arrow in kubernetes/kubernetes at commit 22faa13 (20 November 2026) and failed if one was missing. These are the lines it found.
| From, to | Proof in the source |
|---|---|
| kubectl apply → API server1 apply |
|
| API server → etcdstore |
|
| API server → Deployment controllerwatch |
|
| Deployment controller → API server2 create ReplicaSet |
|
| API server → ReplicaSet controllerwatch |
|
| ReplicaSet controller → API server3 create Pods |
|
| API server → Schedulerwatch |
|
| Scheduler → API server4 bind to node |
|
| API server → Kubeletwatch |
|
| Kubelet → API serverstatus |
|
| Kubelet → Container runtime5 start containers |
|
| Box | Proof in the source |
|---|---|
| kubectl apply |
|
| API server |
|
| etcd | A separate project. The API server is the only component that talks to it. |
| Deployment controller |
|
| ReplicaSet controller |
|
| Scheduler |
|
| Kubelet |
|
| Container runtime | A separate program on the node, reached through the Container Runtime Interface. |
How it was made
An AI agent read the project's source at the commit above and drew this page on a WireMagic canvas through Agent Bridge, the same tools any agent gets when you connect it to the app. The result is an ordinary WireMagic file: download it, open it, and move things around.
You can have your own agent do this for a codebase you know. Connect it, then ask it to draw the architecture of the repository.