Skip to content

Commit 0c58caf

Browse files
committed
Use per-server home PVC template to avoid multi-attach
1 parent 7f127c3 commit 0c58caf

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

config/jupyterhub/01-spawner.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@
99
# Using fixed /home/jovyan mount path because {username} expands differently in
1010
# KubeSpawner (escaped slug) vs base Spawner traits like notebook_dir (raw username),
1111
# causing a path mismatch when usernames contain special characters (e.g. emails).
12-
# Named-server PVC behavior differs across spawner wrappers. For local reliability,
13-
# force one home PVC per user (shared across that user's named servers): claim-{username}.
14-
# This avoids pending spawns like: persistentvolumeclaim "claim-<user>" not found.
15-
c.KubeSpawner.pvc_name_template = "claim-{username}"
12+
# Use one home PVC per user *per server name* so default Jupyter and Pi can run
13+
# concurrently on different nodes without RWO multi-attach conflicts.
14+
# - default server -> claim-{username}
15+
# - pi named server -> claim-{username}{servername}
16+
# (servername expands to empty for default and to a suffix for named servers)
17+
c.KubeSpawner.pvc_name_template = "claim-{username}{servername}"
1618
c.KubeSpawner.storage_pvc_ensure = True
1719
c.KubeSpawner.storage_capacity = "10Gi"
1820
c.KubeSpawner.storage_access_modes = ["ReadWriteOnce"]
1921
c.KubeSpawner.volumes = [
2022
{
2123
"name": "home",
2224
"persistentVolumeClaim": {
23-
"claimName": "claim-{username}",
25+
"claimName": "claim-{username}{servername}",
2426
},
2527
},
2628
]

0 commit comments

Comments
 (0)