Pod Replacement Guarantees

What replaces a lost Pod depends on its owner, a ReplicaSet, StatefulSet, DaemonSet or Job from you or a CronJob. What does each bring back, what survives of the old Pod, and when does nothing return?

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

Pod Replacement Guarantees, Kubernetes diagram

Pod Replacement Guarantees, step by step

  1. The same thing happens to all five at one moment: the Pod is gone and the object leaves the API. That is equally true of every column, so nothing that follows depends on who noticed first. From here the answers differ, and what separates them is what each controller promises, not how fast it reacts.

    Play from step 1
  2. Three of them hand back a NEW Pod. A ReplicaSet replica is interchangeable, so its replacement comes at once with a fresh name. A Job makes one after a back-off delay while its completions are unmet, counting the loss against backoffLimit, 6 by default. The CronJob itself starts nothing before its next tick, but its Job does.

    Play from step 2
  3. Two of them hand back something the lost Pod already had. A StatefulSet returns the identical ordinal and keeps its claim, and the cluster attaches that volume to the Node the replacement lands on. A DaemonSet returns a fresh name, but only to the Node it lost one on, because its count follows the Nodes it targets and never a number you set.

    Play from step 3
  4. The last answer is nothing at all, and here only the DaemonSet gives it. Once the Node is taken away, its Pod is garbage collected with it, and nothing is rescheduled elsewhere, because no other Node is short of one.

    Play from step 4

Sources