Skip to content

Roll robustness follow-ups from #796: edge surge on full nodes, node-requests pre-flight, seed the ghost-sweep counters, exercise the stale-netns snapshot guard #799

Closed

Description

@bpalermo

Follow-ups left open after #798 removed the CNI-DEL deadlock (#796, validated on rev216 2026-09-16: DEL with the agent absent completes in 4 s, proxy hot restart inside the unpin window keeps all 22 listeners, 0 prober errors).

  1. Edge rollout on a full node. charts/aether/templates/edge-deployment.yaml:17-21 uses maxSurge: 1, maxUnavailable: 0; the surge pod (400m) was what got preempted by the proxy DaemonSet on worker-03 during rev214. The precondition has widened: worker-03 84 % and worker-04 80 % CPU requests, both under 800m headroom; rev215/216 avoided a repeat only because the surge pod landed elsewhere. Options: maxSurge: 0, maxUnavailable: 1 (2 replicas behind MetalLB; a one-replica window during rolls is acceptable), or a topologySpreadConstraint / preferred anti-affinity away from nodes at high request utilisation. Chart bump.
  2. Deploy pre-flight. The validation runbook must check node CPU requests (kubectl describe nodes | grep -A5 'Allocated resources' or kubectl top nodes) before a roll and name the tenant workloads (the clj-grpc-soak/grpc-jvm 1-core pod is the current one).
  3. Seed the ghost-sweep counters. agent/internal/cni/server/metrics.go:175 only Adds aether.agent.ghost_sweep.stale_pruned (and siblings) when the count is > 0, so "no series" is their real baseline and they cannot be graded as "0 = healthy" (fix(agent): seed the #638 identity mismatch counters at zero (false-zero in Prometheus) #717 lesson). Seed them at 0 at registration like fix(cni,agent): CNI DEL no longer blocks on the agent; stale-netns pods kept out of every snapshot (#796) #798 did for snapshot.stale_netns_skipped.
  4. Exercise the snapshot-side stale-netns guard on-cluster. fix(cni,agent): CNI DEL no longer blocks on the agent; stale-netns pods kept out of every snapshot (#796) #798's per-generation skip (aether_agent_snapshot_stale_netns_skipped_total) is deployed and seeded but never fired in validation: the replacement agent returns in ~5 s, far inside the 60 s NetnsUnpinDelay, so the entry is reconciled as an orphan (orphans_pruned_total) before the unpin. To exercise the guard, hold the agent down for > 60 s (e.g. scale the agent DaemonSet off one node via a temporary node label/nodeSelector, or kubectl delete pod in a loop) with a terminated app pod on that node, then let it return and assert stale_netns_skipped_total ≥ 1 and a clean first LDS. Also unobservable without node access and still untested: the plugin's agent unreachable at CNI DEL WARN (containerd log), the <pin>.delfail give-up marker path (live-but-erroring agent), and the pin unlink.
  5. Minor: worker-02's proxy handoff took 34.4 s on the rev216 roll (band 16–26 s) and was the only node on the handoff branch; zero cost, unexplained — watch on the next roll.

Refs #796, #798, #717.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Activity

  1. added
    enhancement
    on Sep 16, 2026
  2. bpalermo commented on Sep 16, 2026

    @bpalermo
    OwnerAuthor

    Upstream follow-up to the listener-side finding on #796: envoyproxy/envoy#47492 (branch hot-restart-netns-inherit) asks the hot-restart parent for the listen socket before entering the network namespace and only enters the namespace to bind a fresh socket when the parent has none. Once it ships in the proxy snapshot we pin, a stale netns path no longer drops an inherited listener across a hot restart; #798's per-snapshot stale-netns filter stays as the agent-side guard regardless.

  3. bpalermo commented on Sep 18, 2026

    @bpalermo
    OwnerAuthor

    Cosmetic leftovers from the #802 targeted dead-code check (nothing dead was found; batch these with the items above): docs/runbook.md:761 spells the SPIRE key podReferenceScope where the HCL key is pod_reference_scope; agent/internal/spire/metrics.go:92,100 — the stream parameter of streamFailed/streamReconnected can only ever be svid now that the bundle stream is gone (keep the exported label, drop the parameter); common/spire/spiretest/broker.go:497 NewFakeBroker is exported but package-local (unexport). Optional: fold the two local cert-gen test helpers in agent/internal/spire onto spiretest.CA.

  4. bpalermo commented on Sep 19, 2026

    @bpalermo
    OwnerAuthor

    Follow-ups from the 8-hour soak on rev218 (2026-09-18T23:31:31Z → 09-19T07:31:31Z, PASS; verdict on bpalermo/k8s-talos-main#77). None is a product regression; all are small.

    1. e2e/soak/README.md is wrong about the SHRINK. It says bouncing svc-5 "cannot pollute the k6 error rate or the prober SLI". It cost 18 of the run's 42 mesh-DNS timeouts — the largest episode of the night. Chain: svc-5 4→0 07:01:31Z, restored 07:03:01Z → agent WARN inbound chain references a secret absent from the snapshot (…/sa/svc-5) on w01/w04/w05 at 07:03:03Z → DC (client deadline) access-log entries from the prober 07:03:20–22Z, no UF/UH/URX/NR. Correct the README (keep the SHRINK — it is still the cheap demand-scoped TTL expires under continuous load and ODCDS re-discovery stalls ~5 min: 5-minute per-node outages on nodes with no local replica, invisible to soaks #682 trigger) and grade it as its own episode.
    2. No signal for a healthy SVID rotation. handleSVIDUpdate logs at DEBUG only and metrics.go registers failure instruments only, so rotation had to be inferred from Envoy's envoy_sds_*_version gauges with proxy-roll buckets excluded. Add aether.agent.spire.svid_updates (counter, seeded 0; attribute kind=pod|node|bundle) so rotation — and eventually a CA/bundle rotation, still unobserved under the Broker API — is one query.
    3. Seed aether_agent_ghost_sweep_orphans_pruned_total (and siblings) at 0 — already on this issue; two soaks in a row needed "no series = no prunes" reasoning, and the previous generation's value lingers ~5 min after an agent roll.
    4. Engineer a deterministic agent: ghost-sweep prune leaks the pod's SVID subscription (reference_not_found retries forever) #804 trigger for the harness. Two soaks (one 30-min, one 8-h, 3 agent rolls + 2 TRIPLEs) produced exactly one orphan between them. A churn step that deletes one svc pod on a node during that node's agent restart would make the prune → unsubscribe path a graded bar instead of luck.
    5. First proxy roll of a run is the expensive one (15 timeouts, all five probers; the other five proxy rolls cost 0/1/0/0/0 with identical echo placement). The only difference found: roll Refactor registrar as xDS server #1 replaced a proxy generation born before load started. Inference, not proven — a run whose first proxy roll comes ≥1 h after k6 steady state would settle it.
    6. Hot-node latency after service rolls: 4 of 18 svc Deployment rolls cost 1–4 prober timeouts on worker-05 only, +1.5–2.5 min after the roll; w05's proxy ran 812m CPU vs 506m on w01. Client-side deadline expiries, not routing failures.
    7. Telemetry: aether-proxy, aether-edge and aether-mesh-dns have no service.name stream in VictoriaLogs, so their ERROR lines can only be graded for the current pod generation (raised with the platform side too).
  5. bpalermo commented on Sep 19, 2026

    @bpalermo
    OwnerAuthor

    Status of the 8-hour-soak follow-ups (2026-09-19): item 2 → #806 (svid_updates / bundle_updates counters, sweep counters seeded), items 1/5 + k6 timing → #808 (README/churn.sh), #766 → #807.

    Item 4 (deterministic #804 trigger) — prototype built, tested live, does NOT work; not shipped.

    Design: pin one svc-3 pod with a finalizer (so the API object outlives the sandbox and the restarted agent's resubscribe lookup passes), delete that node's aether-agent pod, delete the svc pod with a 1 s grace while the agent is down, wait for the replacement agent + 20 s, release the finalizer, let the sweep prune the orphan.

    Run on main-worker-04, 12:09:49Z–12:10:28Z:

    UTC event
    12:09:49 agent pod deleted; container gone within ~1 s
    12:09:50 svc pod deleted (grace 1 s)
    12:09:58 replacement agent loads 7 stored pods including the deleted one and resubscribes it (resubscribed … count 7 stored 7) — so the first CNI DEL did land on an absent agent, as intended
    12:09:59 the new agent's termination watch marks it DRAINING
    12:10:28 finalizer released; pod leaves the API
    12:10:44 two setting snapshot in 50 ms with no sweep line: a second CNI DEL, served normally by RemovePod (storage entry, listeners and SVID subscription all removed)
    12:10:48 a third DEL: resource was not found locally
    12:10:58 first sweep pass: storage_pods 7 → 6, stale_pods 0, no pruned orphaned pod, orphans_pruned no series, reference_not_found 0

    So the container runtime issues CNI DEL again when the sandbox is removed (here ~16 s after the pod left the API), and an agent that is back by then cleans up through the ordinary path before the sweep's first pass (agent start + 60 s). That is also the real explanation for why #804's trigger is so rare: it needs every DEL for the pod to miss the agent, or the sweep to win a race against the runtime's retry — a plain agent restart (~8 s down) almost never qualifies, a node-wide TRIPLE occasionally does.

    Consequences:

    • A harness step would have to keep the agent down until the sandbox is removed (tens of seconds, by repeatedly deleting the DaemonSet pod) — and then the pod is gone from the API before the agent returns, so the resubscribe lookup fails and the subscription half of agent: ghost-sweep prune leaks the pod's SVID subscription (reference_not_found retries forever) #804 is not exercised at all. The two halves cannot both be forced from outside the process.
    • The right place for a deterministic test is where it already is: TestSweepPruneUnsubscribesSVID (fix(agent): ghost-sweep prune ends the pruned pod's SVID subscription (#804) #805) drives the exact state in-process. I am dropping the harness idea rather than shipping a step that would log "not exercised" most nights.
    • Side observation worth keeping: RemovePod logs nothing at INFO/DEBUG with the pod name on success — a successful CNI DEL is invisible in the agent log except as two anonymous setting snapshot lines. One pod removed INFO line (pod, namespace, netns) would have saved an hour here; cheap to add with the other logging work.

    The cluster was left clean (svc-3 4/4, agents 5/5 Ready, no pod with a finalizer).

  6. bpalermo commented on Sep 19, 2026

    @bpalermo
    OwnerAuthor

    rev219 (0.92.25-edea7f5: #806 + #807 + #809) deployed 2026-09-19 12:58–13:00Z, perfect-zero roll. Two follow-ups from its validation:

    1. svid_updates{update="rotated"} is not purely "SVID lifetime rotation". Deleting one spire-agent pod (w05, 13:02:59Z) moved pod/rotated 0 → 7 and node/rotated 0 → 1, with unchanged staying 0: a restarted SPIRE agent re-attests and mints fresh SVIDs, so the chain really differs and the classifier is right. The runbook text added in feat(agent): count healthy SVID and trust-bundle updates; seed the sweep counters (#799) #806 ("unchanged is a redelivery after a stream re-subscribe") is therefore only true for a stream that drops while the SPIRE agent stays up; after a SPIRE agent restart the redelivery is a new certificate. Fix the runbook wording, and when grading rotation exclude minutes with a spire-agent restart on that node (kube_pod_start_time for spire-agent), the same way proxy-roll minutes had to be excluded from the Envoy gauges. unchanged remains unexercised in production.
    2. fix(agent,edge): designed startup retries log at WARN, and name who owns the recovery (#766) #807's edge site was not exercised by this roll — both edge pods reached the registrar ~3.3 s after starting, so neither the new WARN nor the ERROR branch ran (unit-tested only). The agent sites were exercised: the spire-agent delete produced 7 + 21 WARN lines and 0 ERROR where rev218 logged 28.
    3. One ERROR remains on a roll, outside fix(agent,edge): designed startup retries log at WARN, and name who owns the recovery (#766) #807: the OUTGOING controller logs error received after stop sequence was engaged on shutdown (12:58:34Z, old build). controller-runtime's message for a runnable returning an error after the manager began stopping — find which runnable and make its shutdown return nil (cf. proxy-supervisor: shutdown admin probe runs on the already-cancelled ctx, so SIGTERM may never drain Envoy (needs reproduction) #771).
  7. bpalermo commented on Sep 19, 2026

    @bpalermo
    OwnerAuthor

    rev220 (0.92.25-b0fce82: #810 + OPA sidecar 1.18.2 → 1.20.2 by dropping the live values pin) deployed 2026-09-19 14:32–14:35Z — perfect-zero roll, 0 ERROR lines on all 28 aether containers, leader election released on shutdown proven at INFO on the new build, pod removed: CNI DEL served one per deleted pod on the right node. New small items from its validation:

    1. The authz (OPA) container has resources: {} — no requests, no limits: unbounded, and invisible to node CPU-request accounting (the Roll robustness follow-ups from #796: edge surge on full nodes, node-requests pre-flight, seed the ghost-sweep counters, exercise the stale-netns snapshot guard #799 pre-flight). Measured 10–11 Mi RSS / ~0 m CPU idle on 1.20.2 (8 Mi on 1.18.2). Give it chart values with small defaults.
    2. OPA 1.20.2 deprecates --disable-telemetry (use "skip-version-check" instead) — update the chart's args before a future OPA drops the flag and the sidecar stops starting.
    3. Envoy ext_authz stats are not exported at all (no *authz* metric name exists in Prometheus), so an authz sidecar regression in evaluation is unobservable; the OPA bump could only be validated as "starts, compiles the policy (import rego.v1 accepted), listens on the UDS". Add the ext_authz family to the proxy stats inclusion list, and give talos one route that actually uses the filter so the prober (or a canary) exercises allow/deny.
    4. aether-controller is a single-replica Deployment: deleting the leader opened a ~49 s admission-webhook gap (/validate, /mutate). Fine on a quiet cluster; under churn that is 49 s of failed pod admissions if the webhooks are failurePolicy: Fail. Worth a second replica (leader election already exists) or a PDB + fast readiness.
    5. Node CPU requests: main-worker-01 is at 85 % (75 % this morning) — the tightest node for the edge surge in item 1 of this issue.
  8. bpalermo commented on Sep 19, 2026

    @bpalermo
    OwnerAuthor

    Closing this umbrella: it had grown into a grab-bag of a dozen unrelated findings across six comments, which is exactly what an issue tracker is bad at. Everything in it is either shipped or now has its own issue.

    Shipped

    Moved to their own issues

    Dropped

    From here on: one issue per finding, opened when it is found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions