awslabs / mountpoint-s3-csi-driver

Built on Mountpoint for Amazon S3, the Mountpoint CSI driver presents an Amazon S3 bucket as a storage volume accessible by containers in your Kubernetes cluster.
Apache License 2.0
213 stars 26 forks source link

Is it possible to connect multiple PV/PVC to the same bucket prefix? #244

Closed schlichtanders closed 2 months ago

schlichtanders commented 2 months ago

Hi there, as kubernetes only allows sharing of PV/PVCs within the same namespace, but we would like to access the same storage from different namespaces, I was wondering whether mountpoint-s3-csi-driver supports this.

Concretely to have several PV/PVC combinations for different namespaces which still access the same s3 data. I couldn't find anything in the documentation.

/triage support

schlichtanders commented 2 months ago

I just realized there is already the possibility to access volums accross namespaces https://kubernetes.io/docs/concepts/storage/persistent-volumes/#cross-namespace-data-sources

The documentation mentions that the CrossNamespaceVolumeDataSource feature gate must also be enabled for the csi-provisioner. Does someone know how to do it for mountpoint-s3-csi-driver?

Sorry for the confusion - this featuregate apparently only initializes another pvc in a another namespace. It is not reusing the same pvc from another namespace... confused myself. Hence the original question is still the only solution today it seems - to have multiple PV/PVCs for each namespace

muddyfish commented 2 months ago

You're correct - currently it's not possible to use a single PVC across multiple namespaces, or a single PV in multiple PVCs.

If you configure the same S3 bucket and path in multiple volumes, you will have the same view of the data. I understand this is not ideal however. I'd recommend adding a 👍 to this feature request: https://github.com/awslabs/mountpoint-s3-csi-driver/issues/125

schlichtanders commented 2 months ago

it is a limitation of kubernetes, so yeah, nothing to do for mountpoint-s3