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
