Repository navigation
fix(chart): a chart release rolls only the pods whose spec changed (#1363) - #1367
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new test rule cannot extract the nested pod template from CronJobs, and its edge-checksum coverage is incomplete.
3 open findings
What changed in this PR
Prevents chart/app version changes alone from rolling Aether workloads while preserving necessary configuration-triggered rollouts.
Changes:
- Separates stable pod labels from versioned object labels.
- Adds edge and OPA configuration checksums.
- Adds regression tests and operator documentation.
| File | Description |
|---|---|
docs/runbook.md |
Documents rollout behavior and checksums. |
docs/configuration.md |
Documents OPA policy rollouts. |
charts/README.md |
Updates pod-label guidance. |
charts/aether/templates/uds-csi-daemonset.yaml |
Uses stable pod labels. |
charts/aether/templates/registrar-deployment.yaml |
Uses stable pod labels. |
charts/aether/templates/mesh-dns-daemonset.yaml |
Uses stable pod labels. |
charts/aether/templates/edge-deployment.yaml |
Adds stable labels and config checksum. |
charts/aether/templates/controller-deployment.yaml |
Uses stable pod labels. |
charts/aether/templates/agent-proxy-daemonset.yaml |
Adds stable labels and OPA checksum. |
charts/aether/templates/agent-daemonset.yaml |
Uses stable pod labels. |
charts/aether/templates/_helpers.tpl |
Splits selector, pod, and object labels. |
charts/aether/Chart.yaml |
Bumps chart version to 2.4.15. |
charts/aether/BUILD.bazel |
Adds rollout regression tests. |
bazel/helm/defs.bzl |
Adds pod-template version-independence rule. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
14249b3 to
c93b4fb
Compare
c93b4fb to
0b574a0
Compare
0b574a0 to
1b02fe2
Compare
1b02fe2 to
60541ca
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The label split preserves selectors and object metadata while comprehensive tests guard version independence and required configuration rollouts.
0 open findings
1 resolved since last review
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
60541ca to
1f683a5
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Fleet-wide rollout semantics and startup-only configuration behavior warrant final human operational review.
0 open findings
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
…1363) Every pod template carried `helm.sh/chart: aether-<version>` and `app.kubernetes.io/version: <appVersion>`, so a chart version bump alone rolled the agent, the proxy (a hot restart on every node), mesh-dns, uds-csi, the registrar, the controller and the edge. A deploy from the commit tag changes both labels with every commit. Pod templates now render `aether.<c>.podLabels` (selector labels, part-of, managed-by). The workload objects keep `helm.sh/chart` and `app.kubernetes.io/version` on their own metadata. Selectors are unchanged. The version labels also restarted, by accident, the two containers that read a chart-rendered ConfigMap only at start. They get a checksum of the data they read instead: `checksum/edge-config` on the edge pod and `checksum/opa-policy` on the proxy pod when the OPA preset is on. The proxy's own bootstrap needs none (the supervisor watches the file). `helm_pod_template_version_test` renders a chart at two versions and fails when any pod template differs, or when a workload object loses its `helm.sh/chart` label. Chart aether 2.4.15. The upgrade that crosses it rolls everything one last time. This removes the chart's own share only. Every in-repo image still gets a new digest with every commit (the revision label, the stamped version), so a deploy of a new commit still rolls every workload; the runbook says so. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
1f683a5 to
fab839a
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The rollout behavior is implemented consistently and protected by focused regression tests.
0 open findings
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
…e; canary objects get their own labels; the canary image is pinned by digest (#1372, #1373, #1374) (#1397) * fix(chart): the prober chart no longer rolls its pods on every release; canary objects get their own labels; the canary image is pinned by digest (#1372, #1373, #1374) #1372: the prober DaemonSet's pod template carried helm.sh/chart and app.kubernetes.io/version (prober.labels), and the chart version carries the commit, so every release rolled every prober pod. The helpers are now selectorLabels / podLabels / labels, as in charts/aether (#1367): the pod template uses podLabels, the objects keep labels. The selector is unchanged. #1373: the authz-canary objects (two ServiceAccounts, two Deployments, the HTTPFilter) used prober.labels and so carried component: prober. They now use prober.authzCanary.labels (component: authz-canary). Object metadata only: the canary Deployments' selectors and pod labels are untouched. #1374: authzCanary.image is curlimages/curl@sha256:58adaa4e... (the multi-arch index of 8.22.0) instead of the tag. No liveness probe is added: a canary that stops already shows as the ext_authz counters no longer increasing. charts/udsecho was checked for #1372 and does not have it: it renders no helm.sh/chart or app.kubernetes.io label at all, and its render is byte-identical at two chart versions. Not changed. Chart prober 1.0.4 -> 1.0.5. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr * docs(runbook): the chart-created Namespace keeps component: prober too (#1373) Review: the list of what -l app.kubernetes.io/component=prober returns left out the Namespace the chart renders with namespace.create. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…licy update no longer rolls the proxy (#1383) The OPA preset runs `opa run --watch`, unconditionally, and the `checksum/opa-policy` annotation (#1367) leaves the proxy pod template. A changed policy is delivered by the kubelet's ConfigMap sync and loaded by the running sidecar; no pod is replaced and Envoy is not hot-restarted. No validation is added: checking a policy before applying it is the responsibility of whoever changes it, and the docs give the commands. Measured on kind (Kubernetes 1.35.8, OPA 1.21.1): - a policy changed by `helm upgrade` decides 46-64 s after helm returns, with the same pod UID, restart counts, DaemonSet generation and Envoy epoch; 8,607 of 8,607 requests through a reload answered, 0 ext_authz errors; - a policy that does not parse or compile is not loaded: the running sidecar keeps the last good one, logs the error at level info and exports no metric; a sidecar that STARTS with it exits 1; - `/policy/policy.rego` is the invocation that works; given the `/policy` directory OPA loads the ConfigMap volume's three copies and refuses to start. Tests: the #1367 checksum tests are turned around (no annotation with the preset on; two policies render one byte-identical DaemonSet, through the new helm_template_value_ignored_test rule), and e2e/authz.sh gains step d. Chart 2.4.19. The first upgrade with the OPA preset on rolls the proxy DaemonSet once. Closes #1383 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…licy update no longer rolls the proxy (#1383) The OPA preset runs `opa run --watch`, unconditionally, and the `checksum/opa-policy` annotation (#1367) leaves the proxy pod template. A changed policy is delivered by the kubelet's ConfigMap sync and loaded by the running sidecar; no pod is replaced and Envoy is not hot-restarted. No validation is added: checking a policy before applying it is the responsibility of whoever changes it, and the docs give the commands. Measured on kind (Kubernetes 1.35.8, OPA 1.21.1): - a policy changed by `helm upgrade` decides 46-64 s after helm returns, with the same pod UID, restart counts, DaemonSet generation and Envoy epoch; 8,607 of 8,607 requests through a reload answered, 0 ext_authz errors; - a policy that does not parse or compile is not loaded: the running sidecar keeps the last good one, logs the error at level info and exports no metric; a sidecar that STARTS with it exits 1; - `/policy/policy.rego` is the invocation that works; given the `/policy` directory OPA loads the ConfigMap volume's three copies and refuses to start. Tests: the #1367 checksum tests are turned around (no annotation with the preset on; two policies render one byte-identical DaemonSet, through the new helm_template_value_ignored_test rule), and e2e/authz.sh gains step d. Chart 2.4.19. The first upgrade with the OPA preset on rolls the proxy DaemonSet once. Closes #1383 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…licy update no longer rolls the proxy (#1383) The OPA preset runs `opa run --watch`, unconditionally, and the `checksum/opa-policy` annotation (#1367) leaves the proxy pod template. A changed policy is delivered by the kubelet's ConfigMap sync and loaded by the running sidecar; no pod is replaced and Envoy is not hot-restarted. No validation is added: checking a policy before applying it is the responsibility of whoever changes it, and the docs give the commands. Measured on kind (Kubernetes 1.35.8, OPA 1.21.1): - a policy changed by `helm upgrade` decides 46-64 s after helm returns, with the same pod UID, restart counts, DaemonSet generation and Envoy epoch; 8,607 of 8,607 requests through a reload answered, 0 ext_authz errors; - a policy that does not parse or compile is not loaded: the running sidecar keeps the last good one, logs the error at level info and exports no metric; a sidecar that STARTS with it exits 1; - `/policy/policy.rego` is the invocation that works; given the `/policy` directory OPA loads the ConfigMap volume's three copies and refuses to start. Tests: the #1367 checksum tests are turned around (no annotation with the preset on; two policies render one byte-identical DaemonSet, through the new helm_template_value_ignored_test rule), and e2e/authz.sh gains step d. Chart 2.4.19. The first upgrade with the OPA preset on rolls the proxy DaemonSet once. Closes #1383 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…licy update no longer rolls the proxy (#1383) (#1436) * feat(chart): the OPA authz sidecar reloads its policy on change; a policy update no longer rolls the proxy (#1383) The OPA preset runs `opa run --watch`, unconditionally, and the `checksum/opa-policy` annotation (#1367) leaves the proxy pod template. A changed policy is delivered by the kubelet's ConfigMap sync and loaded by the running sidecar; no pod is replaced and Envoy is not hot-restarted. No validation is added: checking a policy before applying it is the responsibility of whoever changes it, and the docs give the commands. Measured on kind (Kubernetes 1.35.8, OPA 1.21.1): - a policy changed by `helm upgrade` decides 46-64 s after helm returns, with the same pod UID, restart counts, DaemonSet generation and Envoy epoch; 8,607 of 8,607 requests through a reload answered, 0 ext_authz errors; - a policy that does not parse or compile is not loaded: the running sidecar keeps the last good one, logs the error at level info and exports no metric; a sidecar that STARTS with it exits 1; - `/policy/policy.rego` is the invocation that works; given the `/policy` directory OPA loads the ConfigMap volume's three copies and refuses to start. Tests: the #1367 checksum tests are turned around (no annotation with the preset on; two policies render one byte-identical DaemonSet, through the new helm_template_value_ignored_test rule), and e2e/authz.sh gains step d. Chart 2.4.19. The first upgrade with the OPA preset on rolls the proxy DaemonSet once. Closes #1383 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr * docs: the policy check reads the OPA image from the release, not a hard-coded tag Review on #1436. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr * docs: validate with the OPA image the sidecar runs; say what opa eval --fail catches Review on #1436. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr * docs(chart): the OPA policy rollout is asynchronous per node; validate against a request; read watch events unfiltered (#1383) - `opa eval --fail` is given a representative ext_authz request with `--input`, and the claim is narrowed to what it proves: the decision is defined for that one request. Without an input it rejected a correct policy that has no default. Checked with OPA 1.21.1 against the e2e policy, a policy without a default, and one that does not define the decision. - 27-64 s is an observation on one node, not a bound: each kubelet delivers a ConfigMap update on its own schedule. The docs and the chart comments describe the rollout as unstaged and asynchronous, and say how to confirm convergence per proxy pod. - The runbook's reload check shows the latest watch events, successes included, and says what a null err, a non-null err and no event mean. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr --------- Co-authored-by: Claude Opus 5.5 <[email protected]>


Closes #1363
Bottom of a stack of two (both bump
charts/aether/Chart.yaml); #1368 (for #1364) is on top.Read this first: this is half of what #1363 asks for
The chart no longer puts the release into any pod template. A deploy of a new commit still rolls every workload, for a reason the issue did not know about: every image this repository builds gets a new digest with every commit, whether or not its content changed, and the digest is part of the pod spec.
helm get manifest --revision N, image lines only): all seven in-repo digests (agent, cni-install, proxy-supervisor, mesh-dns, uds-csi, registrar, controller) changed in each of the four deploys from revision 276 to 279. Revisions 276 and 277 are six commits apart that touch the registrar, tests and scripts; cni-install, uds-csi, mesh-dns and proxy-supervisor still got new digests.HEADs, produced seven different digests.bazel/img/go_multi_arch_image.bzlstampsorg.opencontainers.image.revision: <commit>into every image withstamp = "force"(Cannot determine which Envoy a running proxy contains: version gauge mismatches the pin and images carry no provenance labels #837), and the binaries carryVersion = {STABLE_GIT_VERSION}.Every workload runs at least one of those images (the proxy DaemonSet through its
install-supervisorinit container). So after this change the label is no longer a reason to roll, but the images still are. Making an unchanged image keep its digest is a build decision (it touches #837 and the stamped version), not a chart change; I did not attempt it. Reported separately below.What this PR does deliver, measured on kind: an upgrade that changes the chart version and appVersion but not the images rolls nothing (before: everything).
What was on the pod templates
Rendered at two chart versions and two appVersions, the seven pod templates differed in exactly two lines each, and in nothing else (no env var, argument or annotation carries the version):
helm.sh/chart: aether-<version>app.kubernetes.io/version: <appVersion>git describe)Neither had a consumer (search below). Both stay on the DaemonSet / Deployment objects and on every other object. There were no config checksum annotations in the chart before this change.
The helpers are now three per component:
selectorLabels(unchanged),podLabels(selector labels +part-of+managed-by),labels(pod labels + chart + version, for object metadata).One thing the labels did by accident, kept on purpose
Rolling every pod on every release also restarted the two containers that read a chart-rendered ConfigMap only at start. Without a replacement, a changed config would silently not apply. They now roll through a checksum of the data they read:
checksum/edge-config(sha256 of the ConfigMap'sdata, not of the object, whose labels carry the chart version)envoy -c, nothing watches the filechecksum/opa-policy(sha256 of the policy text)opa runwithout--watch: an authorization policy that stayed the old oneThe node proxy's own bootstrap gets no checksum, on purpose: the supervisor watches the file (
--watch-config=true) and hot-restarts in place. The default render gains no annotation. Both checksums are tested to follow their input:aether_edge_config_checksum_changes_testrenders the edge with and withoutedge.admin.enabled=trueand requires the annotation to differ (new rulehelm_template_value_changes_test, added in review; a constant hash fails it), and two policies give two pinnedchecksum/opa-policyvalues.Side effect worth knowing: a policy or edge-bootstrap change at an unchanged chart version was never applied before (no label change, no roll). It is now.
Who reads these labels: searched, found nothing
Patterns:
helm.sh/chart,helm_sh_chart,app.kubernetes.io/version,app_kubernetes_io_version, pod-label relabelling (__meta_kubernetes_pod_label,labelmap,kube_pod_labels,k8s.pod.labels),-l/--selectoron chart or version._helpers.tplfiles (charts,e2e/,e2e/soak/,prober/,docs/observability/,scripts/,.github/, Go)charts/README.md(updated here)k8s-talos-main(read-only; fetched 2026-10-07)gotk-components.yaml. kube-state-metrics hasmetricLabelsAllowlist: []; the log collector extractsapp.kubernetes.io/nameandappfrom pods, nothing else~/aether-tools(deploy and soak helpers)Not searched: live Grafana dashboards and Prometheus series (only the files above).
Selectors are unchanged
A changed selector is an immutable-field error on upgrade. Full render of
mainagainst this branch, default values and with the edge and the authz sidecar on:selector:block (7 workloads, 3 Services) is byte-identical (default: 8 blocks; all on: 10);helm.sh/chart: aether-2.4.14->2.4.15on object metadata (31 / 42 times), and the edge checksum annotation with its comment. Nothing else.aether_selector_labels_testpins each selector to exactly its three labels.Tests, red first
New rule
helm_pod_template_version_test(bazel/helm/defs.bzl):helm templatecannot override the version of a chart it is given, so the rule unpacks the packaged chart twice, rewritesversion:andappVersion:in one copy, renders both with the Bazel-provided helm and compares every workload'sspec.templatebyte for byte. It also asserts that every workload object still carrieshelm.sh/chart: <name>-<version>, and fails if the number of workloads it found is not the number declared.Against the unchanged chart:
After: all pass (
PASS: the 7 pod templates are byte-identical at chart versions 2.4.14 and 999.0.0-otherversion). Guards that were green before and after:aether_selector_labels_test,aether_opa_policy_checksum_off_test. Mutation check: rendering the agent DaemonSet's own metadata withpodLabelsfails the test (carries helm.sh/chart '-' on its own metadata).Measured on kind
Throwaway cluster (kind v0.33.0, the pinned node image, Helm 3.18.4, its own kubeconfig; deleted afterwards). Pods never started there (locally built digests are not in the registry), so this measures what the apiserver's controllers decide, not a running mesh.
version+appVersionchangedmain's chart -> the same chart with onlyversion+appVersionchangedWhat an operator sees
X.Y.Z-<sha>and the appVersion is the commit, so today both labels change on every deploy.kubectl get ds,deploy -A -l app.kubernetes.io/part-of=aether -L helm.sh/chart,app.kubernetes.io/version.kubectl -n aether-system get pods -l app.kubernetes.io/part-of=aether -L controller-revision-hash,pod-template-hash --sort-by=.metadata.creationTimestampbefore and after (runbook, "Which workloads a chart upgrade rolls").Verified
bazel test //charts/... //bazel/helm/..., the Go tests that read the chart templates (//agent/internal/cmd,//agent/internal/proxy/hotrestart,//agent/internal/supervisorcmd,//agent/cmd/uds-csi/...),bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...,make format-check.Not verified
watchConfig), not exercised.Noticed, not changed
charts/proberhas the same two labels on its DaemonSet's pod template (prober.labels).rules_helm'stemplate_patternsmatches only the last document of a multi-document template file.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr