StatefulSet pod index as label?

691 views
Skip to first unread message

Ahmet Alp Balkan

unread,
Sep 13, 2017, 7:46:17 PM9/13/17
to kubernet...@googlegroups.com
I'm curious if having ordinal index for StatefulSet pods would be useful, if Kubernetes exported this information as a label on the pod.

This way a user could create a Service easily selecting a pod in the StatefulSet through its index label, and they would not worry about maintaining a manual Endpoints list (+an headless Service) to achieve this.

I don't use StatefulSets nor I have an use case for this, but I'm curious if this is something users would need at all.

Rodrigo Campos

unread,
Sep 13, 2017, 10:19:26 PM9/13/17
to 'Ahmet Alp Balkan' via Kubernetes user discussion and Q&A
On Wed, Sep 13, 2017 at 04:45:51PM -0700, 'Ahmet Alp Balkan' via Kubernetes user discussion and Q&A wrote:
> I'm curious if having ordinal index
> <https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#ordinal-index>
After thinking a while, I don't see a use case, honestly. I can't think what can
be easier if a service can match ordinarls in stateful sets.

Did you have some rough idea or intuition? (I read you said you didn't have a
use case, but maybe some "gut feeling" or something?)



Thanks a lot,
Rodrigo
Reply all
Reply to author
Forward
0 new messages