Currently when I apply stateful set then pods are getting created with ab-app-0, ab-app-1 , ab-app-2
But I want pods like ab-app-1000, ab-app-1001
Currently when I apply stateful set then pods are getting created with ab-app-0, ab-app-1 , ab-app-2
But I want pods like ab-app-1000, ab-app-1001
The Kubernetes documentation on StatefulSet says the following about ordinal index:
For a StatefulSet with N replicas, each Pod in the StatefulSet will be assigned an integer ordinal, from 0 up through N-1, that is unique over the Set.
So there looks to be no way of customising this. But if your concern is that you need to pass this unique ID to a service, you could do the following in the config file, as proposed in this open github issue:
env:
- name: ZOO_MY_ID
valueFrom:
fieldRef:
fieldPath: metadata.annotations['spec.pod.beta.kubernetes.io/statefulset-index']