<p>I have the following <code>PersistentVolumeClaim</code> and <code>Deployment</code> in Kubernetes:</p>
<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: my-app-storage
spec:
  accessModes:
     - ReadWriteOnce
  resources:
    requests:
      storage: 25Gi
  storageClassName: &quot;gp2&quot;

</code></pre>
<pre><code>...
containers:
   ...
   volumeMounts:
   - name: my-app-storage
     mountPath: /var/my-app/storage
     readOnly: false
   ...
volumes:
  - name: my-app-storage
    persistentVolumeClaim:
      claimName: my-app-storage
</code></pre>
<p>The problem is this is only creating a single volume that is mounted into each pod. I have <code>replicas: 3</code> though. How can I have a volume created per pod? I need to stay using a <code>Deployment</code> and can't migrate to using a <code>StatefulSet</code>. Is this even possible? Currently, this is scheduling all the pods on one single Kubernetes worker node because the volume is shared and only mounted to a single Kubernetes worker node.</p>

Justin
<p>I ended up converting the <code>Deployment</code> to a <code>StatefulSet</code> and this works. Key thing is remove the <code>PersistentVolumeClaim</code> and update the Deployment to a StatefulSet and use the following props:</p>
<pre><code>  volumeClaimTemplates:
  - metadata:
      name: storage
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 16Gi
</code></pre>
