Repository navigation
fix/observability: Prometheus read only root volume - #1000
Draft
marcleblanc2 wants to merge 4 commits into
Draft
marcleblanc2 wants to merge 4 commits into
marcleblanc2 wants to merge 4 commits into
Conversation
The prometheus image now keeps Alertmanager's configuration and state on the /prometheus data volume, so nothing writes to the root filesystem. Needs sourcegraph/sourcegraph#18737 in the pinned image. Amp-Thread-ID: https://ampcode.com/threads/T-01a13cfb-9756-7111-8b29-381a841065e1 Co-authored-by: Amp <amp@ampcode.com>
marcleblanc2
marked this pull request as ready for review
November 11, 2026 03:56
marcleblanc2
marked this pull request as draft
November 13, 2026 11:00
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Open issues
Found in review on 2026-11-13 (review thread), at
b197759. The chart change is one correct line; this PR is a draft until the image it needs is onmain, because nothing but the sentence under Solution was holding the merge back.prometheusimage onmaindoes not have the fix yet. sourcegraph/sourcegraph#18737 is still open, and8.1.4873, the tagmainpins, still starts Alertmanager with--storage.path=/alertmanager. The8.2.0release image does too. Reproduced on EKS with this branch and that image: the pod stays Ready with 0 restarts, Alertmanager drops from three receivers to onlysrc-noop-receiver, and the site configuration showsfailed to write Alertmanager configuration: open /sg_config_prometheus/alertmanager.yml: read-only file system. Nothing pages, so a merge today would silently stop alert notifications on every default install of the insiders chart. Fix: merge aftermainpins an image with the fixmainincharts/sourcegraph/CHANGELOG.mdreadOnlyRootFilesystemback tofalsewhen running an olderprometheusimage with this chart; that sentence is gone. Anyone who pins an older image tag or mirrors images late hits issue 1. Fix: put the sentence back, and name the first version whose image has the fixreadOnlyRootFilesystem: falsewas found in thecloudorcontrollerrepositories, which the description offers as the alternative for CloudTested in this review on the EKS test instance
m5, by upgrading frommainto this branch merged ontomain, with theprometheusimagemainpins:prometheuspod, and the manifest differs frommainby the onereadOnlyRootFilesystemlinemain,/alertmanagerand/tmpare writable and Alertmanager has three receivers. On this branch only the/prometheusvolume is writable, and the result is issue 1, which matches the control under Test planmain, the three receivers returnedProblem
Some customers need a read-only root filesystem on every container, and still need Alertmanager to work
The chart turned
readOnlyRootFilesystemoff forprometheus, because Alertmanager wrote to the root filesystemCustomers who forced it on lost the alert notifications they set in
observability.alertsSolution
Set
prometheus.containerSecurityContext.readOnlyRootFilesystem: true/prometheusdata volumerunAsUser,runAsGroup, andfsGroupare not changedDo not merge until the chart's
prometheusimage includes sourcegraph/sourcegraph#18737:observability.alertsreadOnlyRootFilesystem: falsein Cloud's global overrideTest plan
helm lint charts/sourcegraphandhelm unittest charts/sourcegraphpasshelm templaterendersreadOnlyRootFilesystem: trueon theprometheuscontainer8.1.1335, with this chart change and the image Buildkite built from sourcegraph/sourcegraph#18737helm diffshows only theprometheusimage andreadOnlyRootFilesystemchangeobservability.alertscome back, and a change to them while the pod runs reaches Alertmanagerprometheus:8.1.1335fails withopen /sg_config_prometheus/alertmanager.yml: read-only file system, and keeps only the no-op receiverLinked PRs
Merge in this order, because the two deploy PRs need a
prometheusimage with the fix:Supersedes #858; the other earlier attempts are listed in sourcegraph/sourcegraph#18737
Amp threads
Changelog
prometheusnow runs with a read-only root filesystem