<p>let me put you in context. I got pod with a configuration that looks close to this:</p>

<pre><code>spec:
  nodeSets:
  - name: default
    count: 3
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 5Gi
        storageClassName: repd-ssd-xfs
</code></pre>

<p>I also have my <code>StorageClass</code></p>

<pre><code>apiVersion: ...
kind: StorageClass
metadata:
  name: repd-ssd-xfs
parameters:
  type: pd-ssd
  fsType: xfs
  replication-type: regional-pd
  zones: us-central1-a, us-central1-b, us-central1-f
reclaimPolicy: Retain
volumeBindingMode: Immediate
</code></pre>

<p>I delete the namespace of the pod and then apply again and I notice that the pvc that my pod was using change and bound to a new pvc, the last pvc used by the pod is in state released. My question is that Is there any way to specify to the pod to use my old pvc? The <code>StorageClass</code> policy is <code>Retain</code> but that means that I can still using pvc with status released? </p>

YosefMac
<p>You can explicitly specify the persistent volume claim name in the pod spec if it's a deployment or a standalone pod like the code below:</p>

<pre><code> volumes:
  - name: task-pv-storage
     persistentVolumeClaim:
       claimName: task-pv-claim
</code></pre>

<p>However, if it's a StatefulSet, it will automatically attach to the same PVC every time the pod restarts. Hope this helps.</p>
