liveBook · Manning

Pod management policy

As explained in Kubernetes in Action, Second Edition

A pod management policy is a StatefulSet setting that controls whether pods are created sequentially or concurrently during management operations.

A pod management policy is a StatefulSet setting that controls whether pods are created and deleted sequentially or simultaneously. The default, OrderedReady, preserves ordering guarantees; Parallel relaxes them. section 16.2.5 section 16.5

Choose the policy according to how the workload handles replica lifecycle operations:

  • OrderedReady creates pods in ascending order, waits for each pod to become ready, and deletes pods in reverse order while waiting for each deletion to finish. section 16.2.5
  • Parallel creates and deletes all pods at the same time without waiting for individual pods to become ready. section 16.2.5
  • OrderedReady suits workloads that require each replica to start or stop completely before the next operation; Parallel can simplify initial scale-up for workloads that tolerate concurrency. section 16.1.3 section 16.2.5

Selecting Parallel in a StatefulSet

Set the field in the StatefulSet specification, then apply the manifest: podManagementPolicy: Parallel. For example, a three-replica quiz StatefulSet uses Parallel so its pods are created concurrently. To select the default ordering behavior instead, use podManagementPolicy: OrderedReady.

Table 16.1 The supported podManagementPolicy values
Value
Description
OrderedReady
Pods are created one at a time in ascending order. After creating each pod, the controller waits until the pod is ready before creating the next one. The same process is used when scaling up and replacing pods when they’re deleted or their nodes fail. When scaling down, the pods are deleted in reverse order. The controller waits until each deleted pod is finished before deleting the next one.
Parallel
All pods are created and deleted at the same time. The controller doesn’t wait for individual pods to be ready.

Compare the two supported podManagementPolicy values and their creation, readiness, scaling, replacement, and deletion behavior. section 16.2.5

At the stated time of writing, the policy is immutable. Changing an existing StatefulSet requires deleting and recreating it; --cascade=orphan can preserve its pods during deletion. section 16.2.5

How Kubernetes in Action, Second Edition covers it

How deep it goes
Defines both policies, explains readiness and ordinal behavior, and demonstrates manifests without descending into controller implementation.
Examples
Uses quiz StatefulSet manifests, kubectl apply, watched pod status, and OrderedReady scaling scenarios.
What it assumes
Uses StatefulSet manifests and kubectl commands while distinguishing policy behavior through concrete pod lifecycle examples.
What you can do after
Operate/configure StatefulSets by selecting a policy, applying a manifest, and observing pod lifecycle ordering with kubectl.
How it connects
Connects StatefulSets with readiness probes, scaling, rolling updates, persistent storage, and headless Services.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.