jupyterhub / kubespawner

Kubernetes spawner for JupyterHub
https://jupyterhub-kubespawner.readthedocs.io
BSD 3-Clause "New" or "Revised" License
546 stars 304 forks source link

persist pvc name and/or uid in state for template changes #415

Open minrk opened 4 years ago

minrk commented 4 years ago

pod_name_template and pvc_name_template are configurable string templates that identify objects, e.g. with jupyter-username, but they are customizable to e.g. otherthing-username. Currently, we only use these strings to resolve resources such as pods, pvcs, etc., not the persistent, unique uid of those objects. A problem arises when a deployment might want to change these templates without destroying everything. We currently load pod_name from state, which means we should recover running pods across Hub restart with changing pod_name_template. However, changing pvc_name_template will result in orphaned user data. We should persist and restore pvc_name in state if in use like we do for pod_name, but perhaps it would be even better to persist uids instead of names?

manics commented 4 years ago

https://github.com/jupyterhub/dockerspawner/issues/384 is another use-case for storing this info as state- it would allow a modified idle-culler to remove a volume without needing access to the spawner config or jupyterhub_config.py.

meeseeksmachine commented 4 years ago

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/a-cull-idle-user-service-that-deletes-pvs/4742/14

meeseeksmachine commented 4 years ago

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/a-cull-idle-user-service-that-deletes-pvs/4742/16