Name, stage and shrink a StatefulSet
- 14 min
- 6 steps
- Config, storage and state
Steps
0 of 6 done
Give the kv StatefulSet the headless Service its pod DNS names need, follow a claim across a pod replacement, stage an upgrade with a partition, and make scale-down delete claims.
Step 1 of 6
All three
kvpods indataare running, yetclientcannot resolvekv-0.kv.data.svc.cluster.local. Create the object the StatefulSet names but never creates, so that each replica gets its own DNS name.Checked against the cluster as it changes.
Step 2, not started: Delete pod
kv-1. When the controller replaces it, show the name of the claim the replacement mounts.Step 3, not started: Stage an upgrade to
redis:8.10as a canary: onlykv-2may runredis:8.10, whilekv-0andkv-1stay onredis:8.8.Step 4, not started: The canary is healthy. Let the upgrade reach the remaining replicas.
Step 5, not started: Scaling
kvdown should delete the claims of the removed replicas, while deleting the StatefulSet itself should keep every claim. Set that policy onkv.Step 6, not started: Scale
kvto one replica and wait until only the claim of the replica that remains is left.
Enter runs the command. Tab completes, and the arrow keys recall earlier commands. Control C stops a watch. On an empty line, or after Escape, Tab moves focus out of the terminal.