From 721e771b9078c1562186edc37f4dd882baea6c3a Mon Sep 17 00:00:00 2001 From: KFilippopolitis Date: Fri, 16 Oct 2026 15:06:45 +0300 Subject: [PATCH 1/2] feat(jupyterhub): keep user notebooks running across hub restarts The hub database is already on jupyterhub-claim0, so the hub can leave user servers running when it restarts and pick them up again. --- deployment/kubernetes/templates/jupyterhub.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deployment/kubernetes/templates/jupyterhub.yaml b/deployment/kubernetes/templates/jupyterhub.yaml index bf41538..89b3507 100644 --- a/deployment/kubernetes/templates/jupyterhub.yaml +++ b/deployment/kubernetes/templates/jupyterhub.yaml @@ -236,6 +236,10 @@ spec: secretKeyRef: name: jupyterhub-crypt key: crypt-key + # The hub database lives on jupyterhub-claim0, so user servers can + # keep running while the hub restarts. Older hub images ignore it. + - name: JUPYTERHUB_CLEANUP_SERVERS + value: "false" volumeMounts: - name: jupyterhub-claim0 mountPath: /srv/jupyterhub From bb26d7bce6e54770a57a85d239ac7a4956c2b75b Mon Sep 17 00:00:00 2001 From: KFilippopolitis Date: Fri, 16 Oct 2026 15:28:02 +0300 Subject: [PATCH 2/2] feat(jupyterhub): stop notebooks idle for an hour jupyterhub.cullIdleTimeout (default 3600s, 0 = never) and cullEvery (600s) drive the hub's idle culler. User files stay on their volume. --- deployment/kubernetes/templates/jupyterhub.yaml | 4 ++++ deployment/kubernetes/values.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/deployment/kubernetes/templates/jupyterhub.yaml b/deployment/kubernetes/templates/jupyterhub.yaml index 89b3507..69bdeda 100644 --- a/deployment/kubernetes/templates/jupyterhub.yaml +++ b/deployment/kubernetes/templates/jupyterhub.yaml @@ -240,6 +240,10 @@ spec: # keep running while the hub restarts. Older hub images ignore it. - name: JUPYTERHUB_CLEANUP_SERVERS value: "false" + - name: JUPYTERHUB_CULL_IDLE_TIMEOUT + value: {{ default 0 $jupyterHub.cullIdleTimeout | quote }} + - name: JUPYTERHUB_CULL_EVERY + value: {{ default 600 $jupyterHub.cullEvery | quote }} volumeMounts: - name: jupyterhub-claim0 mountPath: /srv/jupyterhub diff --git a/deployment/kubernetes/values.yaml b/deployment/kubernetes/values.yaml index 37136cf..bd63174 100644 --- a/deployment/kubernetes/values.yaml +++ b/deployment/kubernetes/values.yaml @@ -86,6 +86,10 @@ jupyterhub: codex: baseUrl: "" model: "" + # Stop notebooks idle this many seconds (0 = never), checked every cullEvery + # seconds. User files stay on their volume. Older hub images ignore both. + cullIdleTimeout: 3600 + cullEvery: 600 singleuser: image: repository: hbpmip/mip-jupyter