From fbeb97e90dca4ad9f79602aa87989456072de3c8 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Sun, 22 Sep 2024 16:55:06 +0200 Subject: [PATCH] docs: add example about volume mount in templates upgrade section --- docs/source/templates.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/source/templates.md b/docs/source/templates.md index 9615f9a9..3fb98af1 100644 --- a/docs/source/templates.md +++ b/docs/source/templates.md @@ -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)