Hi all , curious to know if we can share persistent volumes across namespaces ? can we do that or is there any workaround for it ?
Sharing a screenshot, showing that the PV and not namespace dependent. However PVCs are.
So I can do this right…
creating a one storage class for dynamic provisioning instead of PV , and multiple PVC across namespace sharing the storage class ?
Yes, StorageClass is a cluster-wide resource
But still that creates two different PV , my use case is to use the same PV for 2 pvc’s in different namespace.
will claimref sort this issue ?
Unless i am mistaken:
A PVC to PV binding is a one-to-one mapping, you cannot use PV across multiple PVC at the same time.
However a PVC may be used across multiple Pods when the AccessMode is set to ReadWriteMany.
So in your case you cannot share a PV across NS since the PVC are namespace bound to start with.
we can create pv in one namespace1 and can have a service account that can have access to this pv and then use this service account on a pod ?
PVs are namespace independent, cluster-external.
Have no idea about service account part.