An ordinal-based naming scheme gives related StatefulSet pods sequential names such as quiz-0, quiz-1, and quiz-2. Each ordinal identifies one pod, helping StatefulSets enforce at-most-one semantics: two pods with the same identity cannot run concurrently in one namespace. section 16.2.2
During a node failure, the naming scheme supports strict identity handling:
- A disconnected node becomes NotReady while its original pod may still be running. section 16.2.2
- The StatefulSet does not immediately create another pod with the same ordinal identity. section 16.2.2
- After the original pod is forcibly removed, the same ordinal, such as quiz-1, can be recreated elsewhere. section 16.2.2
Inspecting ordinal identities
Running kubectl get pods -l app=quiz can show quiz-0, quiz-1, and quiz-2. After quiz-1 is removed, Kubernetes recreates quiz-1 rather than assigning an unrelated name. section 16.2.2
