Repository navigation
Description
Found by the 30-minute soak on talos-main rev217 (0.92.24-9fc27c8), 2026-09-18.
Symptom
aether_agent_spire_broker_reference_not_found_total{node="main-worker-02"} climbs at ~2/min and never stops (29 at 19:40Z, 38 at 19:45Z; every other node 0). The agent log repeats a Broker subscribe failure for aether-test/svc-3-79c5b9bdf5-sr558 — SPIRE answers NotFound … pod not found on agent node. That pod no longer exists in the API server.
Data-path cost: zero (prober 0 errors on w02, no listener references the pod). It is a goroutine + a gRPC call every ~30 s, per leaked pod, for the agent's lifetime — and it permanently poisons the reference_not_found counter, which proposal 036 uses as a signal.
Mechanism
- The TRIPLE churn step rolled agent + proxy + svc-3 together. The svc-3 pod's CNI DEL landed while w02's agent was down; since fix(cni,agent): CNI DEL no longer blocks on the agent; stale-netns pods kept out of every snapshot (#796) #798 that DEL returns without the agent, so the agent never ran
RemovePodfor it. - The new agent loaded the pod from storage and
runResubscribeStoredPodsresubscribed it (the pod was still in the API server, Terminating, so the liveness GET passed). - The ghost sweep then did its job:
aether_agent_ghost_sweep_orphans_pruned_total{node="main-worker-02"}= 1. ButpruneOnePod(agent/internal/cni/server/ghostsweep.go) removes the storage entry and the listener and never callsspireBridge.UnsubscribePod.RemovePod(pod.go) is the only teardown path that does. - The bridge classifies
NotFoundas transient (correct at CNI ADD, where the kubelet pod list lags), so the orphaned subscription retries at max backoff forever.
So this is not a stale storage entry — storage is clean. It is a leaked subscription. It predates the Broker API (the delegated bridge leaked the same way, silently, because SPIRE's delegated API just never answered); the Broker API's explicit NotFound plus the new counter made it visible, and #798 made the trigger (DEL without the agent) routine rather than rare.
Fix
pruneOnePod unsubscribes the pruned pod's netns. Regression test subscribes an orphan and a live pod on a started bridge, sweeps, and asserts only the orphan's subscription ended (fails without the fix).
Not doing: bounding the NotFound retry inside the bridge. With the sweep owning teardown there is no subscription left to bound, and a bound would reintroduce a failure mode at CNI ADD on a slow kubelet.
Recovery on w02 today: none needed; the leak ends when the agent next restarts.
Activity
fix(agent): ghost-sweep prune ends the pruned pod's SVID subscription (…
bpalermo commentedon Sep 18, 2026
Validated on talos-main rev218 (
0.92.24-15332e2, PR #805) by a 30-minute churned soak, 2026-09-18 T0 20:22:53Z.Before (rev217, same cluster):
reference_not_found{node="main-worker-02"}38 at 19:45Z → 83 at 20:09Z → 100 at 20:19Z (~1.9/min) for one pruned svc-3 pod; ended only because the deploy restarted the agent.After: the TRIPLE step (agent + proxy + svc-3 rolled together, 20:44:53Z) reproduced the trigger on main-worker-04:
NotFoundforaether-test/svc-3-5784fdfcd8-kqts8(pod … not found on agent node) — the only oneghost sweep: pruned orphaned podfor the same pod (+0.425 s)reference_not_found{node="main-worker-04"}still 1,ghost_sweep_orphans_pruned_total= 1, every other node 0Flat for 20 minutes after the prune, where the pre-fix agent added ~2/min indefinitely. n = 1 orphan, but it is the exact production trigger rather than a synthetic one.
Soak around it: liveness 0/44,998; mesh-DNS authoritative 0/44,999,
dns_*zero; k6http_req_failed132/684,005 = 0.0193% (all fiverate<0.01thresholds pass);permission_denied0; 0 restarts/taints/alerts.Side observations for #799:
aether_agent_ghost_sweep_orphans_pruned_totalis not seeded at 0 (no series = no prunes; the old generation's value lingers ~5 min after an agent restart). The svc-4 burst again produced zeroreference_not_foundat CNI ADD — the ADD/kubelet-list race proposal 036 anticipated has not fired once on this cluster.chore(soak): first proxy roll at T0+60, honest SHRINK cost, k6 timing…
chore: post-rev219 follow-ups — rotated wording, a line per served CN…
docs(runbook): record the known-unexercised code paths (#813) (#869)