Skip to content

Commit b24f576

Browse files
committed
docs: add example about volume mount in templates upgrade section
1 parent 97ac911 commit b24f576

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/source/templates.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,21 @@ c.KubeSpawner.slug_scheme = "escape" # no changes from kubespawner 6
103103
c.KubeSpawner.slug_scheme = "safe" # default for kubespawner 7
104104
```
105105

106+
You can also adjust individual template fields to expand independent of
107+
configured slug scheme. If you for example previously have mounted a folder
108+
named `{username}` for a single NFS volume with all user's home folders, a
109+
change of slug scheme could lead to mounting a different folder. To avoid this,
110+
you can stick with the previous behavior for the volume mount specifically by
111+
referencing `{escaped_username}` instead.
112+
113+
```python
114+
c.KubeSpawner.volume_mounts = {
115+
"name": "home",
116+
"mountPath": "/home/jovyan",
117+
"subPath": "{escaped_username}", # matches "{username}" in kubespawner 6
118+
}
119+
```
120+
106121
The new scheme has the following rules:
107122

108123
- the length of any _single_ template field is limited to 48 characters (the total length of the string is not enforced)

0 commit comments

Comments
 (0)