Open mbelak-dtml opened 11 months ago
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
Proposed change
Reasoning
TL;DR: The
stop
method is assumed to only delete the JupyterLab server pod, although the inheritance contract should be that the method deletes any resources associated with the server.The current implemenation makes extending
KubeSpawner
with additional resources very difficult. It assumes that thestop
method just stops the JupyterLab server pod. This is, however, problematic in case additional Kubernetes resources are being cleared in an override of the methodstop
.The
stop
method is called for example here: https://github.com/jupyterhub/kubespawner/blob/0e5bb4610be13865a09e16a6b4833835bce4c45a/kubespawner/spawner.py#L2525-L2533 This is problematic since it's called from thestart
method. However, the overriddenstart
andstop
method might look something like this:In that case the call to
stop
also destroys the custom resources, although it should really just delete the pod.Alternative options
Who would use this feature?
Anyone creating a custom subclass of
KubeSpawner
which deploys additional Kubernetes resources in thestart
method.(Optional): Suggest a solution
Add a private
_stop
method and make the publicstop
method just a thin wrapper around the private method, similar to what's already done withstart
and_start
. Only call the_stop
method in the implementation.