# Mount a unique PVC for each user

**URL:** <https://discourse.jupyter.org/t/mount-a-unique-pvc-for-each-user/8168>\
**Category:** Zero to JupyterHub on Kubernetes\
**Created:** [March 2, 2021, 3:39pm UTC](https://discourse.jupyter.org/t/mount-a-unique-pvc-for-each-user/8168 "2021-03-02T15:39:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![viktoriaas](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/viktoriaas/32/3864_2.png) [@viktoriaas](https://discourse.jupyter.org/u/viktoriaas)\
**Post date:** [March 2, 2021, 3:39pm UTC](https://discourse.jupyter.org/t/mount-a-unique-pvc-for-each-user/8168/1 "2021-03-02T15:39:05Z")

</div>

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](https://github.com/chr-fritz/csi-sshfs) 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.

Thanks,  
Viktoria

---

<div class="post-metadata">

**Author:** ![yuvipanda](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/yuvipanda/32/17_2.png) [@yuvipanda](https://discourse.jupyter.org/u/yuvipanda)\
**Post date:** [March 3, 2021, 11:56am UTC](https://discourse.jupyter.org/t/mount-a-unique-pvc-for-each-user/8168/2 "2021-03-03T11:56:44Z")

</div>

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](https://github.com/berkeley-dsep-infra/datahub/blob/9109104af653550339516da8fe853d839a0fe917/deployments/cs194/config/common.yaml#L18). Everyone gets a dedicated PVC for their postgresql database 😃

---

<div class="post-metadata">

**Author:** ![viktoriaas](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/viktoriaas/32/3864_2.png) [@viktoriaas](https://discourse.jupyter.org/u/viktoriaas)\
**Post date:** [March 3, 2021, 2:33pm UTC](https://discourse.jupyter.org/t/mount-a-unique-pvc-for-each-user/8168/3 "2021-03-03T14:33:18Z")

</div>

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