Journeys · Kubernetes · L1
Deleting a Pod, gracefully
Two things start at once: the cluster stops sending traffic, and the Pod starts saying goodbye.
✓ Validated on v1.37.2 · validation Run 1 · 2026-11-21Preview
The 30-second answer
The API server does not remove the Pod. It stamps it with a deadline: now plus the grace period. Two things start at once. The control plane marks the Pod's endpoint as terminating, and kube-proxy drops it from the Service's rules. The kubelet runs the preStop hook, then has the runtime send SIGTERM. The program exits, the kubelet reports it, and only then is the Pod object deleted. A program that ignores SIGTERM gets SIGKILL when the deadline comes.
Mental model
Closing one till in a busy shop. The manager tells the front office. The office turns the till's sign to closed, so no new customers queue there, and calls a relief cashier. At the same time the floor captain gives the cashier a few minutes to finish, then rings the closing bell.
Where the analogy breaks
In the shop, the sign turns before the cashier is told. In Kubernetes nobody waits for anybody: the sign and the cashier are told at the same moment, by different programs. That is why the preStop hook exists. It buys time so the sign is surely turned before the program stops.
🔒 Free account
Sign up free to play this journey
A free account unlocks every scenario, journey and exam, and saves your progress. No payment, ever.