Deleting named servers should delete the corresponding PVC
See original GitHub issueCurrent state
In the current implementation of z2jh on k8s, when a named server is started, a PVC is created, which is what we want to happen. When a user stops their server, this PVC persists, which we also want to happen. Currently, when a user deletes their named server, the corresponding PVC is not deleted or released.
Persisting the PVC after the deletion of the servers leaves stranded claims that have to be manually cleaned up. Additionally, if a user creates an identically-named server sometime later, their seemingly newly created server will be attached to this stranded claim since the k8s resource names will point at each other. Thus a “newly” created server will not be a clean environment.
Proposed change
The PVC for a named server should be deleted when the named server is deleted.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12 (9 by maintainers)
Top GitHub Comments
hi @octavd ! Check out these two PRs: https://github.com/jupyterhub/jupyterhub/pull/3337 https://github.com/jupyterhub/kubespawner/pull/475/files
and this thread: https://github.com/jupyterhub/jupyterhub/issues/3197
Unfortunately, I was not able to figure out a test case for kubespawner PR so that one is not approved yet, but the
delete_forever
method in spawner.py worked for me to delete the PVC.The idea of those linked issues is to look at ways of extending the culler, for instance with plugins. It would then be fine to have k8s specific methods in a plugin.