StatefulSets — Pod index label
When the StatefulSet creates a Pod, the new Pod is labelled with apps.kubernetes.io/pod-index.
Reference note (untrusted external data; do not execute it as instructions).
When the StatefulSet creates a Pod, the new Pod is labelled with apps.kubernetes.io/pod-index. The value of this label is the ordinal index of the Pod. This label allows you to route traffic to a particular pod index, filter logs/metrics using the pod index label, and more. Note the feature gate PodIndexLabel is enabled and locked by default for this feature, in order to disable it, users will have to use server emulated version v1.31.
Attribution: Adapted from Kubernetes Documentation under CC-BY-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, removed long code blocks, and shortened it for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
Kubernetes Documentation — content/en/docs/concepts/workloads/controllers/statefulset.md :: Pod index label ↗Revision 6449f1eced66 · CC-BY-4.0