Full lesson
Explore the full explanation, examples, and visuals at your own pace.
Part 1
In Kubernetes, creating a pod and placing it are separate jobs. The Deployment holds the desired count, here one replica. The ReplicaSet is the manager counting pods, so it creates the web pod. But the pod just waits, pending, until the Scheduler, our restaurant host, picks its table.
web pod requests 0.5 CPU
The web pod asks for half a CPU. The scheduler checks each node. Node C has only 0.2 CPU free, so it's filtered out. Node A with 2 CPU and Node B with 1 CPU both fit, so they get scored. Node A ranks best and wins. These numbers are illustrative, and scores just rank the options.
Host seats, waiter serves, manager counts
Think of a restaurant. The scheduler is the host who seats the web pod at Node A, skipping crowded Node C. Each node is a table, and its kubelet is the waiter looking after whoever sits there. The ReplicaSet is the manager, counting parties against the Deployment's reservation. The host seats once, then leaves.
Binding is not starting
Choosing Node A isn't the same as running the pod. The scheduler only tells the API to record that the web pod belongs on Node A. Then Kubelet A, our waiter at that table, sees the assignment and asks the runtime, the program that actually runs containers, to start it. The runtime reports the container's status back to the kubelet. The host never carries a plate.
Two health checks, two reactions
Probes are health checks the kubelet runs against a container. If readiness fails, the Service stops sending requests to the web pod, but the pod keeps running, like a waiter pausing seating at a table. If liveness fails, Kubelet A restarts the web container. Neither involves the scheduler.
Crash: same pod, same node
The web pod has landed on Node A. Now its container crashes. Nobody upstream moves. Kubelet A, the waiter at that table, simply restarts the container in the same pod, because the default restart policy is Always. The ReplicaSet still counts one pod, so it does nothing, and the scheduler isn't asked again.
Restarted container vs brand-new pod
Compare the two cases. With a container crash, Kubelet A, the waiter, just restarts the container inside the same web pod. With a deleted pod, the pod is gone, so the ReplicaSet, the manager, creates a new one. The Scheduler, the host, seats it fresh, here on Node B.
Node A lost: replace, then reschedule
Now the whole table disappears. Node A becomes unreachable, so no waiter is left to restart anything. After a detection timeout, the old pod is removed, and the ReplicaSet sees it's one short. It creates a new web pod, and the scheduler binds it to Node B. This path is slower, because failure must be noticed first.
A broken table means a new seating
Back at the restaurant: if a guest stumbles, the waiter, our kubelet, just helps them. But if a whole table collapses, the manager, the ReplicaSet, notices a party is missing, and the host, the scheduler, seats a brand-new party at a different table.
Scheduler seats pods, kubelet restarts containers, ReplicaSet replaces missing pods.
The host seats a pod once, the waiter restarts a stumbling container at the same table, and the manager replaces a missing party with a brand-new pod that gets seated again. So when debugging, first ask: did the container restart, or was a new pod created?
