<h3>As we all know from the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#ordinal-index" rel="nofollow noreferrer">documentation</a>:</h3>

<blockquote>
  <p>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.</p>
</blockquote>

<h3>Example:</h3>

<pre><code>apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: zookeeper-np
  labels:
    app: zookeeper-np
spec:
  serviceName: zoo-svc-np
  replicas: 3
  selector:
    matchLabels:
      app: zookeeper-np
  template:
    metadata:
      labels:
        app: zookeeper-np
    spec:
      containers:
      - name: zookeeper-np
        image: zookeeper:3.5.6
        ports:
        - containerPort: 30005
        - containerPort: 30006
        - containerPort: 30007
        env:
        - name: ZOO_MY_ID
          value: "1"
</code></pre>

<p>The above manifest will create three pods like below:</p>

<pre><code>NAME                     READY   STATUS    STARTS   AGE
pod/zookeeper-np-0       1/1     Running   0        203s
pod/zookeeper-np-1       1/1     Running   0        137s
pod/zookeeper-np-2       1/1     Running   0        73s
</code></pre>

<h3>Question:</h3>

<p>Is there a way to configure this starting index (0) to start from any other integer (e.g 1,2,3 etc.)?</p>

<p>For example, to start the above pod indices from 3 so that the pods created will look like something below:</p>

<pre><code>NAME                     READY   STATUS    STARTS   AGE
pod/zookeeper-np-3       1/1     Running   0        203s
pod/zookeeper-np-4       1/1     Running   0        137s
pod/zookeeper-np-5       1/1     Running   0        73s
</code></pre>

<p>Or if there is only one replica of the statefulset, its ordinal is not zero but some other integer (e.g <strong>12</strong>), so that the only pod created will be named as <strong><em>pod/zookeeper-np-12</em></strong>?</p>

Amit Yadav
<p>Unfortunately, it's impossible, according to <a href="https://github.com/kubernetes/kubernetes/blob/12f36302f9ee98093d0a01910e345825f1d3a86e/pkg/controller/statefulset/stateful_set_control.go" rel="noreferrer">source code</a> 0...n is just slice index of replicas slice. See the last argument to <code>newVersionedStatefulSetPod</code></p>
