Skip to content

Commit

Permalink
Merge pull request #3537 from minrk/fix-pvc-name
Browse files Browse the repository at this point in the history
fix default pvc mounting with kubespawner 7
  • Loading branch information
consideRatio authored Oct 3, 2024
2 parents 3e200ab + c3e818e commit 0ec2b0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions jupyterhub/files/hub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ def camelCaseify(s):
storage_type = get_config("singleuser.storage.type")
if storage_type == "dynamic":
pvc_name_template = get_config("singleuser.storage.dynamic.pvcNameTemplate")
c.KubeSpawner.pvc_name_template = pvc_name_template
if pvc_name_template:
c.KubeSpawner.pvc_name_template = pvc_name_template
volume_name_template = get_config("singleuser.storage.dynamic.volumeNameTemplate")
c.KubeSpawner.storage_pvc_ensure = True
set_config_if_not_none(
Expand All @@ -275,7 +276,7 @@ def camelCaseify(s):
c.KubeSpawner.volumes = [
{
"name": volume_name_template,
"persistentVolumeClaim": {"claimName": pvc_name_template},
"persistentVolumeClaim": {"claimName": "{pvc_name}"},
}
]
c.KubeSpawner.volume_mounts = [
Expand Down
4 changes: 2 additions & 2 deletions jupyterhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ singleuser:
homeMountPath: /home/jovyan
dynamic:
storageClass:
pvcNameTemplate: claim-{username}{servername}
volumeNameTemplate: volume-{username}{servername}
pvcNameTemplate:
volumeNameTemplate: volume-{user_server}
storageAccessModes: [ReadWriteOnce]
subPath:
image:
Expand Down

0 comments on commit 0ec2b0e

Please sign in to comment.