Repository navigation
feat(agent): Cilium-style startup taint to gate pods on CNI readiness - #263
Merged
Merged
Conversation
The CNI plugin fails-closed: until the node agent's gRPC CNI server is serving, a pod's CNI ADD errors and kubelet retries. On a cold node (or an agent roll on a fresh node) that leaves pods churning ContainerCreating. Add a node startup taint, mirroring Cilium's agent-not-ready gate: - common/constants: TaintAgentNotReady = aether.io/agent-not-ready. - agent/internal/node: TaintRemover manager Runnable removes the taint from the agent's OWN node once the CNI server is serving (its UDS exists), best-effort with retry — never fails agent startup. removeTaint is a pure, unit-tested helper. Gated by --remove-startup-taint (default true). - chart: tolerate the taint on the agent + proxy DaemonSets ONLY (workload pods, registrar, controller, edge do NOT — they wait for a ready node); add nodes/patch RBAC for the agent; document that the operator must register nodes with the taint (kubelet --register-with-taints); bump chart to 0.19.0. The data-plane delete guarantee + storage/pod reconcile are separate changes. Refs #261
bpalermo
added a commit
that referenced
this pull request
Jun 22, 2026
…sue #261) (#264) The ghost sweep reconciled the registry against local storage but never reconciled local storage against the node's real pods, so two desync classes went uncured (talos worker-01, 2026-06-22): - Orphan ghost: a missed CNI DEL that left the netns bind-mount pin behind. netnsExists() stats the lingering pin and reports present, so the existing stale-prune never removed it; the agent kept emitting a listener bound to a dead netns (prober-vhbp8) — a connection sink and a latent #245 segfault. - Missing pod: a live, mesh-managed pod with no storage entry (a lost CNI ADD) that therefore had no listener and 100% connection_error (prober-k7vsm), and never self-healed. The agent's manager cache is already scoped to spec.nodeName=<this node>, so listing the node's pods is local and cheap (no new RBAC — it already has pods get/list/watch). The sweep now: - Prunes a stored pod when EITHER its netns is gone (existing) OR its Kubernetes pod no longer exists — by pod identity, regardless of a lingering pin. The pruned pod's registry endpoint then falls through to ghost deregistration as before. If the pod list fails we skip prune-by-absence (an empty list would nuke every entry) but still run the netns prune. - Surfaces live, Running, mesh-managed pods that storage has no entry for: the agent can't synthesize the CNI data to self-heal, so it emits a metric + warning (the pod must be rolled) instead of silently serving no listener. New metrics: ghost_sweep.orphans_pruned, ghost_sweep.missing_storage. Tests: TestSweepPrunesOrphanedPods (lingering-pin orphan pruned + ghost-deregistered, live pod kept) and TestIsMeshManagedK8sPod; existing sweep tests keep a nil k8sClient and skip the pod reconcile via a defensive guard. This is the cure layer; the guaranteed-delete reorder (#262) is the prevention and the startup taint (#263) closes the cold-start window. Claude-Session: https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S Co-authored-by: Claude Opus 4.8 <[email protected]>
The first cut tolerated the taint only on the agent + proxy DaemonSets and made the control-plane Deployments wait for a ready node. That deadlocks a fresh cluster: the controller projects the MeshConfig ConfigMap the agent mounts and blocks on at startup (non-optional volume, "ContainerCreating until it exists"), and the agent only removes the taint once its CNI is serving. So a non-tolerating controller can never schedule to create that ConfigMap -> the agent stays blocked -> the taint is never removed -> nothing bootstraps. They also don't need to wait at all: controller/registrar/edge run in aether-system, and the CNI plugin skips ignored namespaces before ever calling the agent (plugin.go: "skipping CNI add for system pod"), so they never touch the aether CNI and have no node-readiness dependency. The edge is an ingress gateway that dials pods directly and never uses the node proxy. The taint exists to gate mesh-managed user workloads, which aether's own control plane is not — so every aether component tolerates it; only real workloads wait. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S
Owner
Author
Updated: tolerate the taint on controller/registrar/edge (fixes a bootstrap deadlock)The original "only agent + proxy tolerate" decision deadlocks a fresh cluster:
And they don't need to wait anyway: controller/registrar/edge are in Principle: the taint gates mesh-managed user workloads, which aether's own control plane is not. So every aether component (agent, proxy, controller, registrar, edge) tolerates it; only real workloads wait. Thanks @bpalermo for catching this. |
This was referenced Jul 19, 2026
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
The aether CNI plugin fails-closed: until the node agent's gRPC CNI server is serving, a pod's CNI ADD errors and the kubelet retries. On a cold node — or an agent roll onto a fresh node — that leaves pods churning in
ContainerCreating. This adds a Cilium-style startup taint (aether.io/agent-not-ready) so workload pods don't get scheduled onto a node until aether's CNI is actually functional.This is the cold-start prevention layer of #261. The data-plane guaranteed-delete reorder (#262) and the storage↔pods reconcile (#264) are separate, already-merged changes.
What's here
common/constants—TaintAgentNotReady = aether.io/agent-not-ready.agent/internal/node—TaintRemover, a managerRunnablethat removes the taint from the agent's own node (cfg.NodeName) once the CNI server is serving (signalled by its Unix socket existing). Best-effort with retry; never fails agent startup. The filtering logic is a pure, unit-testedremoveTaint(node, key) (changed bool). Gated by--remove-startup-taint(defaulttrue).ClusterRole: addnodespatch(it already had get/list/watch) so it can remove the taint.values.yaml: document that the operator must register nodes with the taint (kubelet --register-with-taints=aether.io/agent-not-ready=true:NoSchedule; Talosmachine.nodeTaints/ kubelet extraArgs). The chart ships removal + tolerations + RBAC; it cannot taint nodes itself.0.18.0→0.19.0.Toleration decision
The taint gates mesh-managed user workloads, which aether's own control plane is not — so every aether component tolerates it; only real workloads wait for a node to become ready.
The control-plane Deployments (controller/registrar/edge) tolerate for two reasons:
aether-system, and the CNI plugin skips ignored namespaces before ever calling the agent (cni/internal/plugin/plugin.go: "skipping CNI add for system pod"). They never touch the aether CNI, so they have no node-readiness dependency. The edge is an ingress gateway that dials pods directly and never uses the node proxy.<release>-mesh-configConfigMap that the agent mounts and blocks on at startup (non-optional volume — "stays in ContainerCreating until it exists"), and the agent only removes the taint once its CNI is serving. So if the controller waited for a ready node, it could never schedule to create that ConfigMap → the agent stays blocked → the taint is never removed → nothing bootstraps.On a fresh cluster: nodes register tainted → agent + proxy + control plane all tolerate and schedule → controller creates the MeshConfig ConfigMap → agent unblocks, serves CNI, and removes the taint → user workloads schedule.
Validation
bazel build //agent/... //common/constants/...green;//agent/internal/node:node_testand//agent/internal/cmd:cmd_testpass.helm templaterenders: agent RBACnodesverbs includepatch; all five aether components (agent, proxy, controller, registrar, edge) carry the toleration; controller RBAC unchanged (stays read-only).Refs #261
🤖 Generated with Claude Code