How to make a volume read-only? #173
-
Suppose the following use-case: A Kubernetes-user creates a Weka FileSystem (either dynamically via PVC or statically). The user populates the volume with some data and later wants to share that volume with other users. But before sharing it, the volume should be marked read-only to prevent modification to the data. How to achieve this? Options we have considered:
Is there any other option to prevent modifications to an entire Weka filesystem? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hello, I will try to answer your questions and please ask for more clarifications if needed.
I would suggest you the following possible solutions:
Please refer to https://github.com/weka/csi-wekafs/blob/main/docs/usage.md#choosing-the-right-volume-type-for-your-workload for additional information regarding different types of volume backings |
Beta Was this translation helpful? Give feedback.
-
@derselbst, I hope I have answered your quesion. Please feel free to ask for additional clarifications or let me know whether it was helpful |
Beta Was this translation helpful? Give feedback.
Hello, I will try to answer your questions and please ask for more clarifications if needed.
With regard to Changing the accessMode of the PV and the PVC to ReadOnlyMany: this functionality is not enforced by Kubernetes on data plane, but only used for scheduling pods. So for example if a PVC mode is set to ReadOnlyMany, K8s will allow attachment of the volume to multiple pods that require read-only access, but will not allow attaching to a pod that requires write access. Unfortunately, the accessMode is not passed to CSI in the NodePublishVolume request hence we cannot enforce it.
Indeed, spec of volume / storageClass is immutable
This is the recommended way to enforce readOnly acc…