<p>On my k8s i would like to run 3 namespace with the same PV. currently i have one namespace setup how do i configure namespace2 and namespace3?</p>
<p><strong>pv.yaml</strong></p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: efs-pv
spec:
  capacity:
    storage: 1Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: efs-sc
  csi:
    driver: efs.csi.aws.com
    volumeHandle: fs-&lt;582a03f3&gt;
</code></pre>
<p><strong>claim.yaml</strong></p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: efs-claim
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: efs-sc
  resources:
    requests:
      storage: 1Gi
</code></pre>
<p><strong>storageclass.yaml</strong></p>
<pre><code>kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: efs-sc
provisioner: efs.csi.aws.com
</code></pre>

<p>PVC can be put in different namespaces by setting metadata.namespace but PV cannot. PVC will pre-bind to the PV with the same name. My solution is just name PV&amp;PVC pair with different for each name space,eg. efs-pv-namespace1, efs-pv-namespace2.</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: nfs-caelus
  namespace: caelus
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: &quot;&quot;
  resources:
    requests:
      storage: 15Gi
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: nfs-caelus
spec:
  capacity:
    storage: 15Gi
  accessModes:
    - ReadWriteMany
  nfs:
    server: 10.100.15.163
    path: &quot;/&quot;
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: nfs-nirvana
  namespace: nirvana
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: &quot;&quot;
  resources:
    requests:
      storage: 15Gi
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: nfs-nirvana
spec:
  capacity:
    storage: 15Gi
  accessModes:
    - ReadWriteMany
  nfs:
    server: 10.100.15.163
    path: &quot;/&quot;
</code></pre>
