-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Context:
I am using the MooseFS CSI provisioner in my Kubernetes cluster to dynamically create PersistentVolumes (PVs).
Version I am trying is: https://github.com/moosefs/moosefs-csi/blob/v0.9.7
However, the directories created by the provisioner on the MooseFS mount are always owned by root:root.
This causes an issue where pods running with a non-root user (UID 1000) cannot write to the mounted PV, resulting in permission errors.
Problem Details
The MooseFS CSI driver is provisioning PersistentVolumes (PVs) successfully.
However, the created directories inside the MooseFS mount are owned by root:root.
The pods attempting to use the PV run as UID 1000, so they do not have write access.
[root@bigdaddy-k8sc-node1-5 volumes]# ls -lrt /opt/nsp/moosefs/client/pv_data/volumes
total 3912
drwxrwx---. 2 root root 1 Feb 6 15:39 pvc-0decea91-2b3c-417f-b76c-f0573358c27c
drwxrwx---. 3 root root 1 Feb 6 16:06 pvc-74a46149-d69b-4a43-ac09-0ea4535f3eef
drwxrwx---. 2 root root 1 Feb 6 16:20 pvc-89ea7061-9d67-46ca-afb1-ec75304dde00
drwxr-xr-x. 2 root root 1 Feb 6 17:18 pvc-9f4f5973-51c9-4cbd-b678-5dac37fd5791
[root@bigdaddy-k8sc-node1-5 volumes]#
What I've Tried
Setting fsGroup in the Pod's SecurityContext
Added this to the pod.spec:
securityContext:
fsGroup: 1000
Issue: This does not seem to propagate ownership changes inside MooseFS.
Tried setting gid=1000 as mount option csi-moosefs-config.yaml (configmap)
This mount option was rejected
Help me figure out how can I set the PV directory ownership to "root:1000".