Commit c5a28ed
prometheus: enable readOnlyRootFilesystem
The Prometheus container previously required readOnlyRootFilesystem: false
because prom-wrapper writes the Alertmanager configuration file to
/sg_config_prometheus/alertmanager.yml at runtime whenever site config
observability.alerts or SMTP settings change. Additionally, Alertmanager
stores state (silences, notification log) at /alertmanager/.
This change enables readOnlyRootFilesystem: true by:
1. Adding an emptyDir volume mounted at /alertmanager for Alertmanager
state storage (--storage.path).
2. Setting ALERTMANAGER_CONFIG_PATH=/alertmanager/alertmanager.yml so
prom-wrapper writes the Alertmanager config to the writable emptyDir
instead of the read-only image layer at /sg_config_prometheus/.
The /prometheus TSDB data path was already handled by the existing PVC,
and /sg_prometheus_add_ons is already a ConfigMap mount. The baked-in
alert rules at /sg_config_prometheus/ are read-only at runtime (only
written at image build time), so they remain accessible on the
read-only root filesystem.
Resolves: https://github.com/sourcegraph/sourcegraph/issues/34012
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dbe72-f13d-7233-aa22-cbeb04d031821 parent 96562d4 commit c5a28ed
2 files changed
Lines changed: 6 additions & 2 deletions
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| |||
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
| 111 | + | |
| 112 | + | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
906 | 906 | | |
907 | 907 | | |
908 | 908 | | |
909 | | - | |
910 | | - | |
911 | 909 | | |
912 | 910 | | |
913 | 911 | | |
| |||
0 commit comments