<p>I am deploying kubernete cluster on AWS EKS and using EBS as persist volume. Below is the spec for a StatefulSet pods who are using the volume. It works fine after deployment. But when I delete the pods by running <code>kubectl delete -f spec.yml</code>, the <code>pvc</code> are not deleted. Their status is still <code>Bound</code>. I think it makes sense because deleting the volume will cause loosing data.</p>
<p>When I redeploy the pods <code>kubectl apply -f spec.yml</code>, the first pod is running successfully but the second one failed. <code>kubectl describe pod</code> command gives me this error: <code>0/1 nodes are available: 1 node(s) had volume node affinity conflict.</code>.</p>
<p>It works fine if I delete all <code>pvc</code>. What is the correct way to redeploy all the pods without deleting <code>pvc</code>?</p>
<pre><code>apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: es
  namespace: default
spec:
  serviceName: es-entrypoint
  replicas: 3
  selector:
    matchLabels:
      name: es
  volumeClaimTemplates:
  - metadata:
      name: ebs-claim
    spec:
      accessModes:
        - ReadWriteOnce
      storageClassName: ebs-sc
      resources:
        requests:
          storage: 1024Gi
  template:
...
</code></pre>

Joey Yi Zhao
<p>This is because the pod got scheduled on a worker node that resides in the different available zone than the previously created PV. Can't really solve it here as you didn't post the StorageClass (ebs-sc) spec, description of the PV. But you can see <a href="https://stackoverflow.com/a/55514852/14704799">here</a> which explained the same.</p>
