Repository navigation
feat: Enable Registrar HA with independent replicas - #45
Merged
Merged
Conversation
Add NeedLeaderElection() to xds.Server and Syncer so all replicas run their gRPC server and sync loop regardless of controller-runtime leader election. Update the registrar proposal to reflect the simplified HA design: no leader election, no write forwarding, every replica is identical and fully independent. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
bpalermo
added a commit
that referenced
this pull request
Sep 7, 2026
…ady (#740) (#743) The three findings from #741's on-cluster validation (talos-main rev209, 2026-09-07). None is a defect in what #741 set out to fix — the agent no longer dies on a cold SPIRE, 0 restarts across a 6m41s blackout — but the first is a regression against the crash loop it replaced. F1. A restarted agent with no SVID cannot handshake to the registrar, so PreListen's bounded registry-ready wait expires, the local-only fallback fires, and the agent PUSHES that snapshot — replacing a complete one and evicting every cross-node endpoint. On main-worker-03 (no local echo replica) ~95% of the node's mesh_dns probes failed for the whole outage, +5,083 errors, while the other four nodes were at exactly 0. The crash loop never did this, because a dying agent publishes nothing and Envoy keeps its last config. PreListen now holds while identity is pending — INFO `holding xDS until this agent has an SVID; Envoy keeps its current configuration` every 15s with a rising elapsed — and the registry wait plus its local-only fallback apply unchanged from the moment identity exists. Mid-life is already correct and is untouched: once a snapshot is published the cache keeps it. F2. The controller's node-taint guard re-armed `aether.io/agent-not-ready` 30s after the agent went NotReady, and the agent's own remover — gated on the CNI socket and conflist chaining only (#667) — dropped it ~50ms later, eight times in a row. The node was tainted for ~50ms per 30s, i.e. never. The remover now consults the SAME readiness aggregate the kubelet polls, so both controllers read one verdict; the socket+chained conditions keep their #667 semantics. This is safe now that spire-server, spire-agent and the SPIFFE CSI driver tolerate the taint (k8s-talos-main #45), which is why SPIRE was kept out of the gate before. F3. Recovery was announced 2m11s early: readyz `spire-svid` passed 3s after the SVID landed while every mTLS client kept failing `could not get X509 bundle`. Two causes, both fixed — readiness now means SVID AND the bundle for its trust domain (the WaitingSource publishes its source only when both are servable), and the registrar client is woken on identity, resetting the gRPC ClientConn's own backoff (at its ~120s cap by then, answering from the cached handshake failure rather than dialling) and cutting the retry sleep short. Also: /readyz?verbose prints `spire-svid failed: reason withheld` because controller-runtime redacts checker errors, so each check now logs its reason once per transition — WARN `spire-svid readiness failing` / INFO `… passing`. Runbook and the values.yaml toleration note updated; the tolerations are now REQUIRED, not advisory. `--spire-enabled=false` (#421) is byte-identical: no gate, no check, no hold. Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr Co-authored-by: Claude Fable 5.1 <[email protected]>
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.
Summary
NeedLeaderElection() boolreturningfalsetoxds.ServerandSyncerso all replicas run their gRPC server and sync loop independently of controller-runtime leader electionDesign rationale
Leader election and write forwarding are unnecessary because:
Test plan
bazel test --config=llm //registrar/...— all tests passbazel test --config=llm //agent/...— all tests pass (xds.Server changed)bazel build --config=llm //registrar/cmd/registrar/...— binary buildsbazel build --config=llm //agent/cmd/agent/...— binary builds🤖 Generated with Claude Code