Commit b794f3a
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 b794f3a
2 files changed
Lines changed: 15 additions & 2 deletions
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
50 | 60 | | |
51 | 61 | | |
52 | 62 | | |
53 | 63 | | |
54 | 64 | | |
55 | 65 | | |
| 66 | + | |
| 67 | + | |
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
| |||
72 | 84 | | |
73 | 85 | | |
74 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
75 | 90 | | |
76 | 91 | | |
77 | 92 | | |
| |||
| 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