Node Failure and Pod Recovery

A Node suddenly goes silent, yet for several minutes its Pods stay listed on it and nothing replaces them, even with healthy Nodes left. How long until replacements run somewhere else, and why so slow?

Play the animation 6 steps, animated, plays on a computer or a tablet

Node Failure and Pod Recovery diagram: Node failure and eviction

Node Failure and Pod Recovery, step by step

  1. Kubelet on Node-1 proves liveness with two heartbeats. It renews its Lease in kube-node-lease every 10s and PATCHes Node.status when it changes or else every 5 min. The node-lifecycle-controller counts either as a sign of life, but the Lease renewal is the one that lands well inside its 50s grace period.

    Play from step 1
  2. The Kubelet on Node-1 stops renewing (kernel panic, network partition, or Kubelet crash). The Lease grows stale, but the Pods on the Node still show Running for now.

    Play from step 2
  3. After --node-monitor-grace-period (default 50s), the node-lifecycle-controller flips Ready from True to Unknown: it cannot tell whether Node-1 died or is just unreachable. Pods are still on the Node, and eviction has not started.

    Play from step 3
  4. The node-lifecycle-controller adds the taint node.kubernetes.io/unreachable:NoExecute. Kubernetes had already given this Pod a 300s toleration for it, which it does for any Pod that does not set one itself. DaemonSet Pods set theirs with no tolerationSeconds, so this never evicts them. The 300s now ticks down.

    Play from step 4
  5. The toleration expires. The taint-eviction-controller marks the Pod with a DisruptionTarget condition, then deletes the Pod with a plain DELETE that bypasses PodDisruptionBudgets (unlike kubectl drain, which uses the PDB-aware Eviction API). The Pod gets a deletionTimestamp and sits in Terminating: the unreachable Node-1 may still run the container, and the entry clears only when the Kubelet answers, the Node object is deleted, or someone forces it.

    Play from step 5
  6. The owning ReplicaSet (of a Deployment) sees the missing replica and creates a replacement Pod. Scheduler picks the healthy Node-2 and Kubelet there starts it. End-to-end recovery takes about 50s plus 300s by default, the grace period plus the toleration.

    Play from step 6

Sources