diff --git a/content/en/docs/concepts/workloads/controllers/statefulset.md b/content/en/docs/concepts/workloads/controllers/statefulset.md index e7482851c4..53d57cb4ed 100644 --- a/content/en/docs/concepts/workloads/controllers/statefulset.md +++ b/content/en/docs/concepts/workloads/controllers/statefulset.md @@ -437,6 +437,20 @@ Statefulset, don't set `.spec.replicas`. Instead, allow the Kubernetes {{}} to manage the `.spec.replicas` field automatically. +### Ordinals + +{{< feature-state for_k8s_version="v1.26" state="alpha" >}} + +`.spec.ordinals` is an optional field that allows for configuration of the replica numbers assigned +to pods. It defaults to nil. You must enable the `StatefulSetSlice` +[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) to use this field. Once +enabled, you can configure the following options: + + * `.spec.ordinals.start`: By default, the StatefulSet controller creates replica pods ordered from +`0` to `.spec.replicas-1`. If the `.spec.ordinals.start` field is set, the StatefulSet controller +will create replica pods ordered from `.spec.ordinals.start` to +`.spec.ordinals.start + .spec.replicas - 1`. + ## {{% heading "whatsnext" %}} * Learn about [Pods](/docs/concepts/workloads/pods). diff --git a/content/en/docs/tutorials/stateful-application/basic-stateful-set.md b/content/en/docs/tutorials/stateful-application/basic-stateful-set.md index 024fdacdbf..6acbb36982 100644 --- a/content/en/docs/tutorials/stateful-application/basic-stateful-set.md +++ b/content/en/docs/tutorials/stateful-application/basic-stateful-set.md @@ -131,6 +131,11 @@ Notice that the `web-1` Pod is not launched until the `web-0` Pod is _Running_ (see [Pod Phase](/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase)) and _Ready_ (see `type` in [Pod Conditions](/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions)). +#### Custom replica numbering + +Note: To customize the replica numbering of pods in a StatefulSet, see +[Ordinals](docs/tutorials/stateful-application/basic-stateful-set/#ordinals). + ## Pods in a StatefulSet Pods in a StatefulSet have a unique ordinal index and a stable network identity.