Mount a unique PVC for each user

Hi all,
I have set up a z2jh in our environment. We run a kerberized NFS stroage where each user has his/her own home. Usually, everybody has data needed for computations inside these homes. It is quite impractical to always copy some data for users to certain PVCs so I was thinking about ability to mount a unique pre-created PVC for each user separately.

We use this csi-sshfs kubernetes plugin for creating PV+PVC for user and it does work fine, it is possible to mount home directory. The PVC can have an arbitrary name so if singleuser part in values.yaml had an option similar to

mountUnique: yes
mountUniquePath: /home/[username]-home
noMountUnique: [username1, username2]

the Pod template that is spawned could just add these two into the template. The name has to be known at this point so it could be substituted and it would be up to the cluster admin to create the PVC right way.

Now, it is allowed only to mount shared volumes but I do not want every person have access to other’s homes, nonsense. However, I do not know about any way how to specify extraVolumes for users separately. Is there anyone who could help or advise whether this is good idea? I’m 99% sure it is not possible at this time, but maybe could be implemented.


Assuming this is in addition to the default dynamically created home PVC, I’ve some config that might be useful! I create and give each user their own unique PVC with some custom code here. Everyone gets a dedicated PVC for their postgresql database :smiley:

1 Like

Thank you very much! This is exactly what I was looking for, I didn’t think of using extraConfig, works as expected :grin:

1 Like