Repository navigation
feat(chart): multi-replica Deployments spread across nodes by default; identity-gate flags follow the webhook; a SPIRE-served webhook without mesh SPIRE is documented as supported (#1412, #1428, #1432, #1434) - #1454
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The upgrade documentation incorrectly guarantees that identity-gate images never require pulling during concurrent rollouts.
1 open finding
What changed in this PR
Adds configurable node spreading for multi-replica control-plane Deployments and aligns identity-gate flags with webhook availability.
Changes:
- Adds shared
soft|required|nonenode-spread behavior and tests. - Disables identity-gate flags when no mutating webhook renders.
- Updates SPIRE and upgrade documentation; bumps chart to 2.4.20.
| File | Description |
|---|---|
docs/runbook.md |
Documents rollout and scheduling effects. |
docs/configuration.md |
Documents new settings and SPIRE behavior. |
charts/aether/values.yaml |
Adds node-spread defaults and guidance. |
charts/aether/templates/registrar-deployment.yaml |
Uses shared spread helper. |
charts/aether/templates/edge-deployment.yaml |
Uses shared spread helper. |
charts/aether/templates/controller-deployment.yaml |
Replaces default affinity and gates identity flags. |
charts/aether/templates/agent-proxy-daemonset.yaml |
Clarifies SPIRE socket behavior. |
charts/aether/templates/_helpers.tpl |
Implements node-spread rendering and validation. |
charts/aether/Chart.yaml |
Bumps chart version to 2.4.20. |
charts/aether/BUILD.bazel |
Adds Helm rendering tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bpalermo
force-pushed
the
feat/1434-deployment-spread
branch
from
October 8, 2026 16:34
20cdff2 to
2f73eb2
Compare
bpalermo
force-pushed
the
feat/1434-deployment-spread
branch
from
October 8, 2026 16:36
2f73eb2 to
7718b53
Compare
…; identity-gate flags follow the webhook; a SPIRE-served webhook without mesh SPIRE is documented as supported (#1412, #1428, #1432, #1434) #1434: the registrar and the edge already rendered a soft hostname spread, and the controller a preferred anti-affinity term about its own replicas; replicas still ended up on one node. Measured on kind (a tainted control plane plus two or three workers, the three Deployments rolled together twenty times), two things defeated the spread: - the controller's default preferred anti-affinity against the registrars' node. The scheduler applies such a term in both directions, so it pushed each new registrar off the nodes holding a controller with the weight of the registrar's own spread. That default is removed; controller.affinity is rendered only when set. - the constraint counted the old ReplicaSet's pods during a rollout. It now carries matchLabelKeys: [pod-template-hash] (Kubernetes >= 1.27). One helper, aether.nodeSpread, renders the constraint for the three Deployments. <component>.nodeSpread picks soft (default), required (DoNotSchedule plus nodeTaintsPolicy: Honor; refused below 1.27) or none; a non-empty <component>.topologySpreadConstraints still replaces it outright. The controller gains nodeSpread and topologySpreadConstraints. #1432: --identity-gate=true and the gate's flags are passed only when the mutating webhook renders (aether.controller.mutatingWebhook). #1428: documented, no template change: the controller's --identity-gate-image defaults to the agent image, so a new agent image rolls the controller. #1412: spire.enabled=false with controller.webhook.spire=true is a supported pair. values.yaml, docs/configuration.md and two comments said or implied otherwise; a template test now pins that the pair renders coherently. Chart 2.4.20. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
force-pushed
the
feat/1434-deployment-spread
branch
from
October 8, 2026 16:41
7718b53 to
9408d22
Compare
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.

Closes #1434
Closes #1432
Closes #1428
Closes #1412
Chart
aether2.4.19 -> 2.4.20 (rebased onto #1436, which took 2.4.19; the only conflict was the version line).#1434: what was actually wrong
The issue says the registrar has no anti-affinity or topology spread. It has: since #635 the registrar and the edge render a soft hostname spread, and the controller a preferred anti-affinity term about its own replicas. The cluster the issue was observed on carries that constraint on the registrar Deployment, and both replicas (same ReplicaSet, created 28 s apart in one rollout) were on one of five workers anyway. So the question became why a soft rule that is there loses.
Measured on kind (pinned v0.33.0 / Kubernetes 1.35.8, one tainted control plane plus workers). The pods are stand-ins: the chart's rendered
tolerations,affinity,topologySpreadConstraints, labels, selector and rollout strategy, with onepausecontainer. The three Deployments are rolled together, as a chart upgrade rolls them, twenty times per variant; the number is how many rollouts ended with both replicas of a Deployment on one node (controller / edge / registrar).main(measured at 2.4.18; #1436 did not touch these fields)mainwithout the controller's "off the registrars' node" termmatchLabelKeysadded, that term kept (my first attempt)matchLabelKeysadded, that term goneTwo causes:
matchLabelKeys: [pod-template-hash](on by default for spread constraints from Kubernetes 1.27) makes it count the new ReplicaSet alone. This is the smaller cause for the registrar and the whole cause for the edge's surge-free roll on two workers.The first row is what I committed first, on the theory that (2) was the cause. The measurement said otherwise, so the PR changed.
What I did not establish: that the five-worker observation in the issue had exactly this mechanism. The scheduling events of that rollout were gone. The three-worker row (5 of 20 on
main, 0 of 20 here) is the closest reproduction I have.What changes
aether.nodeSpread, renders the spread constraint for the registrar, the controller and the edge.<component>.nodeSpread: soft | required | none, defaultsoft.soft:maxSkew: 1,kubernetes.io/hostname,ScheduleAnyway, plusmatchLabelKeys: [pod-template-hash]on Kubernetes >= 1.27.required:DoNotScheduleplusnodeTaintsPolicy: Honor. Refused at render time below 1.27, where the apiserver would dropmatchLabelKeysand leave a rule that does not keep a rollout's new replicas apart.none: no constraint. Any other value fails the render, including YAMLoff(booleanfalse).<component>.topologySpreadConstraintsreplaces the constraint (not merged), as before for the registrar and the edge; new for the controller.controller.affinityis rendered when set and nothing is rendered when empty. What TRIPLE-window liveness anomaly: 2-for-2 across consecutive soaks, different mechanism each time #629 wanted (never the controller and both registrars on one node) follows from each Deployment spreading its own replicas. This reverses a deliberate default from feat(charts): spread the control plane and UDS fleet off the hot-spot node (#629) #635; it is the part of this PR to look at. Settingcontroller.affinityto the old term brings the first row of the table back.--identity-gate=trueand the gate's seven other flags are passed only when the mutating webhook renders (aether.controller.mutatingWebhook); otherwise--identity-gate=false.controller.webhook.identityGate.imageinvalues.yaml.values.yamlsays atspire.enabledwhatfalsemeans; thespire.enabledrow ofdocs/configuration.mdno longer lists the webhook certificate; the comment onaether_identity_gate_no_spire_testno longer says the pair cannot be rendered; the comment inagent-proxy-daemonset.yamlno longer readsspire.enabled=falseas "SPIRE is not deployed" (that comment block is the only change to the file).Why a spread constraint and not pod anti-affinity
matchLabelKeysis on by default for spread constraints from 1.27; for pod (anti-)affinity only from 1.31.requiredcannot wedge a small cluster:DoNotSchedulewithmaxSkew: 1refuses a node only while another counted node holds fewer replicas. Required anti-affinity leaves every replica beyond the node count Pending.Render before / after
helm template aether charts/aether -n aether-systemonmain(re-run after the rebase onto #1436) and on this branch, compared as parsed objects (YAML comments dropped; the generated self-signed webhook pair and thehelm.sh/chartobject label masked).edge.enabled=truenamespaceInjection=false,injectPodNdots=falsespire.enabled=false,controller.webhook.spire=true--kube-version 1.26.0No DaemonSet, RBAC object, webhook configuration or ConfigMap differs in any of them.
Registrar and edge pod templates, in every render on Kubernetes >= 1.27:
topologySpreadConstraints: - maxSkew: 1 topologyKey: kubernetes.io/hostname whenUnsatisfiable: ScheduleAnyway labelSelector: matchLabels: app.kubernetes.io/name: aether-registrar app.kubernetes.io/instance: aether app.kubernetes.io/component: registrar + matchLabelKeys: + - pod-template-hashController pod template, in every render:
(below 1.27 without the last two lines). Controller, additionally and only with both webhook switches off (#1432):
With the default (both switches on) the controller's arguments are unchanged: the only difference in its pod template is the scheduling block above. With
spire.enabled=falseand the SPIRE webhook on, the controller already had--identity-gate=false; the only difference is again the scheduling block.What an operator sees on upgrade
controller.affinitykeeps it. A release that relied on the default "off the registrars' node" preference loses it.--identity-gate=falseon the controller. The flags were inert.required.After the upgrade (also in the runbook, "Chart 2.4.20"):
Single-node and small clusters
Run on a one-node kind cluster with the stand-in Deployments: with
softand withrequired, all six pods schedule, arollout restartof the three (a surge pod on the same node) completes, and scaling each to three replicas leaves none Pending.On a control plane plus two workers,
requiredwith three replicas and withoutnodeTaintsPolicy: Honorleft the third replica of each Deployment Pending (the tainted control plane counts as an empty node nothing can be put on). That is whyrequiredrendersHonor. Its price, also seen there: a node that is NotReady or cordoned is tainted too and is not counted while it is, so replicas may share another node meanwhile.Tests
helm_template_*targets incharts/aether/BUILD.bazel, written first and run against the unchanged chart.Red on
main, green here (17):aether_node_spread_default_{registrar,controller,edge}_testaether_node_spread_required_{registrar,controller,edge}_testaether_node_spread_none_test(the off switch)aether_node_spread_invalid_{word,yaml_off}_test,aether_node_spread_required_old_kube_test(rejected values)aether_node_spread_user_replaces_controller_test,aether_node_spread_old_kube_controller_testaether_controller_default_affinity_test,aether_no_default_affinity_test,aether_controller_affinity_user_replaces_testaether_identity_gate_no_mutating_webhook_{self_signed,spire}_test(chart: the identity-gate flags are passed to the controller when no mutating webhook renders #1432)Guards, green before and after (8):
aether_node_spread_user_replaces_{registrar,edge}_test: a user's constraints replace the chart's, with nothing merged in.aether_node_spread_old_kube_{registrar,edge}_test: below 1.27 the constraint is whatmainrenders.aether_identity_gate_{namespace_injection_only,ndots_only}_test: with either switch on the gate stays on.aether_webhook_spire_without_mesh_spire_testand..._absent_test(chart: controller.webhook.spire=true is accepted with spire.enabled=false #1412): the controller gets--spire-enabled, itscsi.spiffe.iovolume and--identity-gate=false; the agent and the registrar get--spire-enabled=false; no broker socket, no Workload API volume on the agent, the proxy or the registrar, no Secret.bazel test //charts/... //bazel/helm/...(212 pass, after the rebase), the lint build andmake format-checkpass locally.Not verified
softcan still lose there;requiredis the answer when it must not.matchLabelKeys, the first new edge replica is placed without regard to the old one still serving, so both live replicas can share a node during the roll. Not measured.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr