# Mount pv based on script on user pod

**URL:** <https://discourse.jupyter.org/t/mount-pv-based-on-script-on-user-pod/2936>\
**Category:** Zero to JupyterHub on Kubernetes\
**Created:** [December 21, 2019, 2:21pm UTC](https://discourse.jupyter.org/t/mount-pv-based-on-script-on-user-pod/2936 "2019-12-21T14:21:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mshamber](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mshamber/32/1411_2.png) [@mshamber](https://discourse.jupyter.org/u/mshamber)\
**Post date:** [December 21, 2019, 2:21pm UTC](https://discourse.jupyter.org/t/mount-pv-based-on-script-on-user-pod/2936/1 "2019-12-21T14:21:41Z")

</div>

When the user pod starts I want to mount their personal pv and also run a script to find the names of other pv to mount. And then mount those also to the user pod.

Any ideas about a good way to implement this? Will i need to fork jupyterhub and build my own image?

In my case I am using azure and the script would connect to active directory and find groups the user belongs to which corresponds to pv names that will be mounted.

Thanks,  
Mike

---

<div class="post-metadata">

**Author:** ![mshamber](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mshamber/32/1411_2.png) [@mshamber](https://discourse.jupyter.org/u/mshamber)\
**Post date:** [December 21, 2019, 6:53pm UTC](https://discourse.jupyter.org/t/mount-pv-based-on-script-on-user-pod/2936/2 "2019-12-21T18:53:18Z")

</div>

I am thinking the customization point is in kubespawner. [https://github.com/jupyterhub/kubespawner](https://github.com/jupyterhub/kubespawner)

---

<div class="post-metadata">

**Author:** ![mshamber](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mshamber/32/1411_2.png) [@mshamber](https://discourse.jupyter.org/u/mshamber)\
**Post date:** [December 21, 2019, 8:04pm UTC](https://discourse.jupyter.org/t/mount-pv-based-on-script-on-user-pod/2936/3 "2019-12-21T20:04:04Z")

</div>

Looks like I can use modify\_pod\_hook to add the volumes to mount. Assuming I can make the call to azure from there and import the libraries I need.
