-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deleting named servers should delete the corresponding PVC #446
Comments
Steps towards resolving this issue
RelatedMy understandingI think we need to expose an API in the Spawner base class that JupyterHub can use when Delete is pressed. Then, the spawner can be allowed to make cleanup actions such as removing a PVC it has created for the named server, or the user if we delete a user. I'm moving this issue to KubeSpawner which is responsible for cleaning up the PVC, and then I'm creating a new issue in JupyterHub. |
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗 |
Can we move this to jupyterhub-idle-culler instead? There's discussion of expanding its role:
Potentially it could also clean up "orphaned" volumes and other resources. As a standalone service this should be faster to develop than a new Spawner/JupyterHub API. If we later decided to make it a core part then then the work done in jupyterhub-idle-culler would provide useful input into the core design. |
@manics hmmm, then the Culler would need to become k8s aware it sounds like to me. If the jupyterhub-idle-culler currently is generic to JupyterHub, I think this issue should stay in KubeSpawner. Thank you for connecting these related issues together @manics! The question in my mind is not to flesh out a viable implementation path to resolving the issues. With the path I suggest, this belongs in KubeSpawner, but if we would embed k8s logic in jupyterhub-idle-culler, then it would belong there I think. Hmmm... I think what's requested in the culler, is cleanup of inactive resources, while this is about cleanup of actively deleted user/named-servers. I find them to be related, because the cleanup logic may be the same. |
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. |
Hi @consideRatio @manics I see in spawner.py this code: kubespawner/kubespawner/spawner.py Line 1970 in 40fa25a
If I wanted to implement this, would I need to add a new method in spawner.py that calls the DELETE persistent volume API request? And then how to call this method from JupyterHub? Am new to this code so any advice would be great :) Thanks! |
Hi @manics @consideRatio @minrk If there is interest in this change, I would be happy to submit a PR, just let me know. Thanks |
Hello, It would be amazing to have that feature implemented in kubespawner. Is there any chance this will be implemented? |
hi @octavd ! Check out these two PRs: and this thread: jupyterhub/jupyterhub#3197 Unfortunately, I was not able to figure out a test case for kubespawner PR so that one is not approved yet, but the |
Hey @nsshah1288 , so i was able to run your modified jupyterhub + kubespawner in an openshift 4 env. Is there any way to speed up this feature to be added in the official branch? It would be very nice that these features available. |
Hi @octavd , great that it works for you! |
Hi @manics @consideRatio could you please review the PR here: #475 ? |
Current 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.
The text was updated successfully, but these errors were encountered: