Skip to content

feat(node): re-arm the agent-not-ready taint across reboots and agent outages - #571

Merged
bpalermo merged 1 commit into
mainfrom
feat/569-node-taint-lifecycle
Jul 19, 2026
Merged

bpalermo merged 1 commit into
mainfrom
feat/569-node-taint-lifecycle

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Fixes #569.

Problem

The aether.io/agent-not-ready:NoSchedule startup taint (#263) only ever fired at node registration, and its remover was one-shot at agent startup. The 2026-07-19 incident review found three gaps that leave a node schedulable while the agent is not serving:

  • G1 — a reboot never re-applies register-with-taints; the on-disk CNI config keeps the kubelet Ready, so the node schedules pods before the agent is back → ContainerCreating on fail-closed CNI ADDs.
  • G2 — removal was one-shot; a taint (re-)applied to a running node was never removed.
  • G3 — k8s's own not-ready taints track kubelet NotReady, not the aether "Ready but agent not serving" window.

Design

Two cooperating controllers, split by write direction. No new flags (proposal 031); the grace period is a compiled constant.

  • Agent (agent/internal/node.TaintRemover) — now a reconciler on its own Node (predicate-filtered by node name). Removes the taint whenever it is present and the CNI socket is serving (socket gate kept; requeues while CNI is down). NeedLeaderElection=false, best-effort. Closes G2. The pure removeTaint helper + its unit tests are preserved; TaintRemover stays exported (only wiring changed to .SetupWithManager).
  • Controller (controller/internal/nodetaint.Guard) — new leader-elected guard. Watches Nodes + agent DS pods (app.kubernetes.io/name=aether-agent) and adds the taint on a node with no Ready agent pod past a 30s grace, debounced so routine agent rolls don't flap it. Never removes. Closes G1. Control-plane nodes are handled data-driven: the guard only re-arms a node that has no Ready agent pod, and the agent DS has no control-plane toleration/nodeSelector, so control-plane nodes are naturally skipped.
  • Effect stays NoSchedule — NoExecute rejected (it would evict mesh pods on every agent roll).

Chart / RBAC

  • Controller ClusterRole += nodes [get,list,watch,patch], pods [get,list,watch].
  • Bumped aether chart 0.78.0 → 0.79.0.

Toleration audit

workload tolerates?
agent DS (incl. cni-install initContainer) yes (existing)
aether-proxy DS yes (existing)
controller / registrar / edge Deployments yes (existing)
workload / test / conformance manifests no (verified by repo-wide grep)

The external SPIRE agent DaemonSet must also tolerate the taint — set it in the spire helm values under spire-agent.tolerations (documented in values.yaml and the proposal; this chart can't touch the external DS).

Tests

bazel test //agent/... //controller/... — 33/33 pass. New unit tests: guard (missing agent → taint after grace; flap within grace → no taint; already-tainted → idempotent; never removes; other-node agent ignored; pod→node mapping) and reconciling remover (re-added taint → removed once socket present; socket absent → kept + requeued).

Proposal: docs/proposals/033_node-taint-lifecycle.md. Non-goal: container-restart waves (#567).

🤖 Generated with Claude Code

https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR

… outages (#569)

The aether.io/agent-not-ready:NoSchedule startup taint only existed at node
registration and its remover was one-shot. Three gaps let a node become
schedulable while the agent was not serving: reboots never re-apply
register-with-taints (G1), a re-applied taint was never removed (G2), and k8s's
own not-ready taints don't cover the "kubelet Ready but agent not serving" window
(G3).

- Agent: TaintRemover becomes a reconciler on its own Node — removes the taint
  whenever it is present AND the CNI socket is serving (keeps the socket gate,
  NeedLeaderElection=false, best-effort). Closes G2.
- Controller: new leader-elected nodetaint.Guard — watches Nodes + agent DS pods
  and re-arms the taint on a node with no Ready agent pod past a 30s grace
  (debounced so routine agent rolls don't flap it). Never removes. Closes G1.
- Chart: controller ClusterRole += nodes get/list/watch/patch, pods
  get/list/watch. Bump aether chart to 0.79.0. Toleration audit: agent/proxy DS
  + controller/registrar/edge Deployments already tolerate; no workload/test
  manifest does. SPIRE agent DS (external chart) documented in values + proposal.
- docs/proposals/033_node-taint-lifecycle.md.

Grace is a constant, not a flag (proposal 031). Effect stays NoSchedule
(NoExecute rejected: it would evict mesh pods on every agent roll).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR
@bpalermo
bpalermo merged commit 1beb629 into main Jul 19, 2026
14 checks passed
@bpalermo
bpalermo deleted the feat/569-node-taint-lifecycle branch July 19, 2026 22:55
bpalermo added a commit that referenced this pull request Jul 19, 2026
…viction (#566, #567) (#572)

* feat(agent): ghost-sweep prune circuit breaker + lost-ADD self-heal eviction (#566, #567)

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR

* chore(chart): bump to 0.80.0 (0.79.0 taken by #571)

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

node lifecycle: re-arm the agent-not-ready taint across reboots and agent outages

1 participant