BeCuriouzBeCuriouz

Learn something new every day

☁️ Cloud & Infrastructure
🔁

Kubernetes doesn't fix crashes — it just refuses to accept them

💡 Kubernetes keeps systems healthy not by reacting to crash events, but by endlessly comparing what you asked for against what actually exists and closing the gap.

When a container dies at 3 a.m. and quietly comes back to life, it feels like Kubernetes "noticed the crash and reacted." It didn't. Kubernetes is declarative: you hand it a description of the world you want ("run 3 copies of this app"), called the desired state, and it stores that as the source of truth. Your YAML file isn't a command; it's a wish.

Behind the scenes, controllers run a never-ending reconciliation loop: observe the actual state of the cluster, compare it to the desired state, and take whatever action closes the gap. Only 2 pods running but you asked for 3? The controller starts one. This is why the system is self-healing — nobody sends a "restart" instruction when a pod dies; the loop simply sees a mismatch on its next pass and corrects it.

This design is level-triggered rather than edge-triggered: it doesn't chase individual events, it repeatedly checks the current level and converges toward the goal. Even if the controller misses an event, sleeps, or restarts, the next loop still finds the same mismatch and fixes it — no lost signals, no stuck state.

🔁 Kubernetes doesn't fix crashes — it just refuses to accept them — BeCuriouz