question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deleting named servers should delete the corresponding PVC

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
nsshah1288commented, Mar 11, 2021

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.

1reaction
manicscommented, Oct 6, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Delete the Storage classes, PVC and PV objects after ... - IBM
You have uninstalled the IBM Cloud App Management (ICAM) deployment by deleting the corresponding Helm Release using Workloads -> Helm ...
Read more >
PersistentVolume(s) objects with Reclaim policy set to Delete ...
After deleting the pods and PVC (almost simultaneously), the PV(s) with reclaim policy set to Delete remains in Released state and objects ...
Read more >
1491139 – Data is not cleaned up when local PV is deleted.
Yes, it should run as root. However, even if it is a permissions error it should not delete the PV before it has...
Read more >
Kubernetes PV refuses to bind after delete/re-create
Note that after deleting PVC , PV remains in Released status: $ kubectl get pv packages-volume NAME CAPACITY ACCESS MODES RECLAIM POLICY ...
Read more >
Using Finalizers to Control Deletion - Kubernetes
You may think you've deleted something, only to find it still ... However, they don't necessarily name code that should be executed; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found