Skip to content

doc: mount volume for config file overrides

Warren Gifford requested to merge k/docs into main

Created by: keegancsmith

Rather than using subpath we mount the full volume. This allows kubernetes to update the configmap when it changes. It requires the full volume since it does updates via symlinks. For example here is the ls output on sourcegraph.com once we use this approach:

# ls -la /etc/sourcegraph
total 12
drwxrwxrwx    3 root     root          4096 Sep 30 08:17 .
drwxr-xr-x    1 root     root          4096 Sep 30 08:17 ..
drwxr-xr-x    2 root     root          4096 Sep 30 08:17 ..2020_09_30_08_17_45.768252600
lrwxrwxrwx    1 root     root            31 Sep 30 08:17 ..data -> ..2020_09_30_08_17_45.768252600
lrwxrwxrwx    1 root     root            18 Sep 30 08:17 extsvc.json -> ..data/extsvc.json
lrwxrwxrwx    1 root     root            27 Sep 30 08:17 global-settings.json -> ..data/global-settings.json
lrwxrwxrwx    1 root     root            16 Sep 30 08:17 site.json -> ..data/site.json

When a new configmap update goes out kubernetes writes the data into a directory like "..2020_09_30_08_17_45.768252600" and then can atomically update symlinks.

We also suggest users mount to /etc/sourcegraph. This is a more natural path for this configuration data than under /mnt which should just contain volume mounts. Additionally /mnt has other mounts in it, so we require an empty directory as the target.

Part of https://github.com/sourcegraph/sourcegraph/issues/14019

Merge request reports

Loading