Stateful updates
Ordering is not application consensus
With the default OrderedReady policy and starting ordinal zero, healthy scale-up proceeds from lower to higher member numbers and scale-down in reverse. The controller waits for the required readiness or termination conditions. A new member becoming Ready does not prove that the ledger has caught up with its peers. Parallel can relax scaling order; only use it if the application can tolerate concurrent starts and stops.
Stage a rolling update
updateStrategy: type: RollingUpdate rollingUpdate: partition: 2Partial spec for a three-member set using the ordinary one-at-a-time rollout behavior. Change the Pod template to a reviewed compatible version. Only ordinal 2 is eligible when partition is 2. Lower ordinals stay on their earlier revision, even if replaced. Decreasing partition to 1 then 0 permits the remaining updates. This is not a traffic-percentage control or a proof that the new and old versions can coexist.
A failed update stops progress
Without a partition, a normal ordered rolling update replaces the highest member first, waits for it to be ready (plus any configured minReadySeconds), then proceeds downward. If ledger-2 never becomes Ready, do not assume ledger-1 will update. In the synthetic stalled-status.json snapshot, two old members remain ready and the new highest member is unready. Inspect the new Pod’s status, events and logs; check configuration, compatibility and health before any further changes.
OnDelete and rollback boundaries
OnDelete leaves existing Pods on their current templates until they are replaced; it does not automatically advance a rolling update. For a stalled OrderedReady rollout, restoring the known-good template may not be sufficient: upstream documentation describes cases where an operator must also remove affected bad-revision Pods using normal graceful deletion after validating identity, storage, application quorum and termination safety. Do not force-delete or blindly restart all members. Rolling back a template does not roll back an on-disk format migration. Consult the application’s recovery plan.
Inspect rather than guess
In an approved cluster, use a command of the form kubectl --kubeconfig <approved-lab-file> --context <approved-lab-context> -n ledger-study get statefulset ledger -o yaml (substitute placeholders; do not paste literally). Check currentRevision, updateRevision and readyReplicas, then identify the individual Pod’s revision and readiness. These fields are observed state, not promises. The actual release, feature gates and application contract determine rollout behavior; this lesson excludes newer concurrent update and experimental strategy options.
Practice
Work through rollout.json without running kubectl. Predict attempted ordinals for partition 0, 2 and 3, and explain the stall at ordinal 2. Then propose the safest investigation order for stalled-status.json. Name one test of application health that Pod readiness alone cannot supply.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Stateful updates — knowledge check
Apply the chapter concepts using synthetic offline scenarios.
Under a normal ordered rollout of three ready members, which ordinal updates first?
With partition 2 and three members, which is eligible for the new template?
What happens when the new highest member never becomes Ready in the ordinary ordered rollout?
What does OnDelete change?
What must be considered before rolling back a stateful workload?