Skip to content

Commit

Permalink
docs: add example about volume mount in templates upgrade section
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Sep 22, 2024
1 parent 12e80d8 commit fbeb97e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/source/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ c.KubeSpawner.slug_scheme = "escape" # no changes from kubespawner 6
c.KubeSpawner.slug_scheme = "safe" # default for kubespawner 7
```

You can also adjust individual template fields to expand independent of
configured slug scheme. If you for example previously have mounted a folder
named `{username}` for a single NFS volume with all user's home folders, a
change of slug scheme could lead to mounting a different folder. To avoid this,
you can stick with the previous behavior for the volume mount specifically by
referencing `{escaped_username}` instead.

```python
c.KubeSpawner.volume_mounts = {
"name": "home",
"mountPath": "/home/jovyan",
"subPath": "{escaped_username}", # matches "{username}" in kubespawner 6
}
```

The new scheme has the following rules:

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

0 comments on commit fbeb97e

Please sign in to comment.