Repository navigation
Helm: hash only the config data in checksum/* pod annotations - #16571
Merged
Merged
Conversation
Contributor
Signed commits reportAll 3 commits between |
Contributor
|
The changes look good to me, thank you.
@DrFaust92 could upload the public key, associated with the key, that you'd used to sign the commit to your github account. As the CI bot mentioned above, all repositories in the "grafana" org now require commits to be signed and verified by github. |
The checksum/config and checksum/alertmanager-fallback-config annotations hashed the entire rendered ConfigMap, whose metadata.labels include helm.sh/chart. That value changes on every chart version bump, so every Mimir pod was restarted on upgrade even when the configuration was unchanged. Add a mimir.configMapOrSecretContentHash helper that hashes only the data section, and use it for both annotations. A pure version bump no longer changes the checksums, while any real config change still restarts the pods. The golden records are unaffected: build.sh strips both checksum lines from the generated manifests. Signed-off-by: Ilia Lazebnik <ilia.lazebnik@gmail.com>
Signed-off-by: Ilia Lazebnik <ilia.lazebnik@gmail.com>
mimir.podLabels set helm.sh/chart, so the chart version was part of every pod template and a version bump recreated every pod on upgrade, even with the checksum annotations fixed. The label stays on the objects themselves. Signed-off-by: Ilia Lazebnik <ilia.lazebnik@gmail.com>
DrFaust92
force-pushed
the
helm-checksum-config-data
branch
from
September 15, 2026 02:03
1709230 to
7e50503
Compare
56quarters
approved these changes
Sep 15, 2026
5 tasks
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.
What this PR does
Stops
helm upgradefrom restarting every Mimir pod when only the chart version changed. Two things caused it, and both are fixed here:checksum/configandchecksum/alertmanager-fallback-confighashed the entire rendered ConfigMap or Secret, whosemetadata.labelsincludehelm.sh/chart. A newmimir.configMapOrSecretContentHashhelper hashes only thedatasection, and is used inmimir.podAnnotations, both alertmanager workloads and the gateway deployment.mimir.podLabelssethelm.sh/chartdirectly, so the chart version was part of every pod template regardless of the annotations. That line is gone; the label stays on the objects themselves, where it is still visible.Verified with
ci/test-oss-values.yaml: rendering against a bumped chart version now leaves all 20 pod templates byte-identical, where previously 18 of them changed. Changingmimir.structuredConfigstill moves the checksums and rolls the pods, as before.Adopting this release recomputes the annotations once, so the pods roll a single time on that specific upgrade — called out in the changelog.
The same approach is used by the loki chart (
loki.configMapOrSecretContentHash) and was recently adopted by argo-cd (argoproj/argo-helm#4044) and prometheus-node-exporter (prometheus-community/helm-charts#7264).The golden records are unaffected:
build.shstrips both thechecksum/*andhelm.sh/chartlines from the generated manifests.Which issue(s) this PR fixes or relates to
n/a
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]. If changelog entry is not needed, please add thechangelog-not-neededlabel to the PR.about-versioning.mdupdated with experimental features.