Skip to content

agent: startup is fatally coupled to the SPIRE Workload API — a 25 s SVID wait exits the process (2–4 restarts per node on every cold boot; #662 family) #740

Closed

Description

@bpalermo

Observation (power-failure cold boot, 2026-09-07 15:50–16:03Z, rev208)

Every agent crashed 2–4 times at boot with

Error: failed to create SPIRE Workload API source ...: context deadline exceeded

then exit 1, because spire-server-0 itself was not serving yet (it crashed twice at 16:00:22Z on its aws_kms plugin: STS AssumeRoleWithWebIdentity … InvalidIdentityToken — it races the OIDC issuer irsa.palermo.dev that is hosted in this same cluster behind envoy-gateway → MetalLB, whose VIP was announced only at 16:00:19Z; recovered 16:00:35Z). The controller and registrar showed the same cascade (3 restarts each). #668 decoupled agent startup from the OTel collector (0 refusals this boot — that fix held); the SPIRE source is the remaining hard startup dependency. Self-limiting, but it costs ~60 s of mesh readiness per boot plus a restart storm that makes every post-mortem noisier.

Ask

Treat the Workload API like #668 treats the collector: wait for the first SVID with a retrying loop (bounded backoff, log at INFO with an elapsed counter, WARN after N minutes), keep the manager running but hold readiness (readyz = spire-svid not yet), and never exit 1 on a transient SPIRE outage. The proxy side already tolerates SDS arriving late (the absent-secret WARN → secret_served:true transient from #715), so nothing downstream needs the process to die. Validate on a cold boot (or by scaling spire-server to 0 for 60 s on a quiet cluster): agents log the waiting line and reach Ready without a restart.

Related platform follow-up (GitOps, separate issue): spire-server's KMS plugin should retry instead of Fatal on the transient STS failure so the upstream race is removed too.

Refs #662, #668, #715; incident record project_incident_power_failure_20260907 (memory).

Activity

  1. bpalermo commented on Sep 7, 2026

    @bpalermo
    OwnerAuthor

    Plan (2026-09-07)

    Where the coupling is

    workloadapi.NewX509Source is called in exactly one place, common/spire/tls.go:60 (NewSourceWithTimeout), with the hard-coded SourceTimeout = 25s (tls.go:36) that #668 introduced to turn the SDK's unbounded first-SVID wait into a bounded one — bounded fatal, which is this issue. Four callers, all fatal today: agent agent/internal/cmd/root.go:337 (setupSpireSource, before m.Start, so /readyz cannot even answer during the wait), edge edge.go:226, controller controller/internal/cmd/root.go:198 (earliest of all — before manager.Bootstrap, for the webhook cert), registrar registrar/internal/cmd/root.go:346.

    Everything downstream already tolerates a late identity: the SPIRE→SDS bridge dials lazily and retries forever (agent/internal/spire/bridge.go:150-217), nodeSource is already an interface (bridge.go:61-65) whose GetX509SVID errors are retried on a 30 s ticker, the cache skips upstream-mTLS injection until SetNodeIdentity lands (cache/mtls.go:106), and Envoy tolerates the absent secret (#715). Mid-life stream drops are already fine: go-spiffe reconnects forever on a context.Background() watcher and keeps the last SVID. The defect is strictly the one-shot creation. PreListen does not touch SPIRE, so #700/#712's ordering is untouched.

    The fix (the #668 shape)

    1. common/spire: a narrow SVIDSource interface (x509svid.Source + x509bundle.Source + Updated()), every TLS helper widened to it; new WaitingSource — a Runnable that creates the source in a retry loop (per-attempt deadline 10 s, jittered backoff 1 s→30 s like the bridge), never fatal, ErrNoSVIDYet until the first SVID, INFO waiting for the SPIRE Workload API with attempt/elapsed, escalating to WARN after --spire-wait-warn-after (default 2m).
    2. Agent: setupSpireSource → startSpireIdentity, returns immediately in the same slot (root.go:243); trust domain late-bound through a tiny atomic holder seeded with cfg.MeshDomain (already the only value that can work: root.go:766 authorizes against it unconditionally) and verified on first SVID (WARN + LoadListenersFromStorage re-run if it ever differs — it is merge-safe). Bridge gets an Updated() wake so the first node identity is served immediately instead of on the 30 s tick.
    3. Readiness gate spire-svid beside cni-chained, with a 2 m dwell equal to the warn threshold. This is the non-obvious decision: the controller's node-taint guard re-arms aether.io/agent-not-ready:NoSchedule on any agent NotReady > 30 s (controller/internal/nodetaint/guard.go:31,194), and spire-server does not tolerate that taint — a hard-from-t=0 gate would let a >30 s SPIRE hiccup taint every node and prevent spire-server itself from being rescheduled. With the dwell, the 2026-09-07 boot (SPIRE healthy 16:00:35Z, agents up by 16:02:45Z) produces zero NotReady and zero taints; a real outage (>2 m) still escalates. Pinned by a constant test spire dwell > taint guard grace. Do not add SPIRE to the agent-down + conflist strip = silently unmeshed pods: the gauge goes absent (not 0) and the taint gate doesn't check chaining #667 taint gate itself (that is the CNI never-issues-ADD failure, a different class; SPIRE is fleet-correlated exactly like fix(agent): decouple startup from OTel export so a shedding collector cannot crash-loop agents (#662) #668's collector argument).
    4. Registrar client: IdentityReady func() bool so a stream that cannot handshake before the SVID lands logs INFO deferred until this agent has an SVID instead of the ERROR fix(agent): stop logging the startup watch-stream handoff as an ERROR (#700) #712 removed.
    5. Metrics: aether.agent.spire.wait_seconds (seconds-oriented buckets, prober: aether_probe_request_duration_seconds records SECONDS into the OTel default (millisecond-oriented) bucket boundaries — every ~2 s timeout lands in le=5, latency panels are flat #732), aether.agent.spire.source_restarts (must stay 0), gauge aether.agent.spire.svid_ready.
    6. Chart: spire.waitWarnAfter: 2m threaded to all four binaries; values.yaml note that spire-server and spire-agent must tolerate the agent-not-ready taint; runbook section "The agent is stuck waiting for SPIRE" (signature of the fix working = waiting lines + 0 restarts + no failed to create SPIRE Workload API source).
    7. Tests, all hermetic: a fake SpiffeWorkloadAPIServer on a temp UDS (the bridge_reconnect_test.go pattern), never-fatal / attempt-elapsed / warn-escalation / becomes-ready / backoff-bounded; readyz table incl. the dwell; startSpireIdentity returns in <100 ms with an unreachable socket; SPIRE-off (ci(conformance): MESH-HTTP (east-west GAMMA) job + cleartext mesh for SPIRE-off #421) byte-identical; bridge late-identity push; registrar deferral. Negative controls recorded per fix(agent): decouple startup from OTel export so a shedding collector cannot crash-loop agents (#662) #668. No e2e change (CI runs spire.enabled=false).

    Validation on talos-main

    Scaling spire-server to 0 alone does not reproduce it — the local spire-agent serves from cache. Tier 1 (one node): scale spire-server to 0, wait 60 s, delete that node's spire-agent pod AND its aether-agent pod; expect Running with 0 restarts, waiting… INFO lines, readyz spire-svid ok inside the dwell and failing after, no taint inside the dwell; scale back to 1 → ready within ~10 s, taint cleared. Tier 2 (fleet): same with rollout restart ds/spire-agent + ds/aether-agent, under 10 min, no workload creation in the window. SLI must be flat throughout (Envoy serves on its last certs). Pre-flight the SVID TTL (abort if < 30 m). PromQL/LogsQL lines in the plan; note ssl_fail_verify_san_total needs the _total suffix.

    Sequencing

    PR 1 = agent (this issue), soaked per the recipe. PR 2 = controller/registrar/edge (mechanical once SVIDSource exists; controller webhooks fail open — failurePolicy: Ignore — so a late cert is strictly better than today's crash). spire-server's own aws_kms Fatal is GitOps (k8s-talos-main #44), not here.

  2. bpalermo commented on Sep 7, 2026

    @bpalermo
    OwnerAuthor

    On-cluster validation of PR #741 — talos-main rev209 / chart 0.92.9-1559e83

    Run 2026-09-07 19:14–19:28Z. Tier 1 = PARTIAL. Tier 2 was NOT run — the recipe gates it on
    "only if Tier 1 is clean", and Tier 1 was not clean. Detail and reasoning below.

    Pre-flight: default_x509_svid_ttl: 4h, agents' SVIDs issued 19:09–19:11Z, so >3h50m remaining
    (recipe requires >30m). --spire-wait-warn-after=2m confirmed on the DaemonSet.

    The core claim is PROVEN

    Assertion Result Evidence
    Agent Running, 0 restarts throughout PASS aether-agent-tsjjr survived a 6m41s SPIRE blackout; baseline 0 → final 0; fleet-wide 0
    No failed to create SPIRE Workload API source PASS 0 occurrences as a log message; 0 FATAL lines. It appears only as the error field inside the never-fatal waiting lines
    waiting… INFO with rising attempt/elapsed PASS attempts 1→13, elapsed 10.1s → 391.2s, backoff bounded at the 30s cap
    Escalates to WARN after 2m PASS 6 INFO, then WARN at attempt 7, elapsed 138.6s > warnAfter 120s
    readyz spire-svid ok inside the dwell PASS pod 1/1 Ready at T_del+44s with no SVID
    readyz fails after the dwell PARTIAL fails correctly, but prints spire-svid failed: reason withheld, not the documented no SPIRE SVID after 2m10s (socket …)
    No taint inside the dwell PASS node clean until 19:19:38.9Z
    svid_ready = 0 during, 1 after PASS w03 1→0→1; other four nodes stayed 1
    source_restarts absent/0 PASS true zero — wiring verified in common/spire/metrics.go; an OTel counter emits no series until first Add
    wait_seconds recorded once PASS count=1, sum=391.1935s, matching the log's elapsed to the ms
    Registrar logs INFO deferral, no ERROR PASS first failed to start watch stream ERROR at 19:23:11.539Z — 0.5s after the SVID landed
    envoy_server_live = 1 on w03 PASS 1 throughout
    liveness non-success = 0 PASS 0 of 298,495, control-tested

    Finding 1 — the prober SLI is NOT flat

    The PR states "the prober SLI must be flat throughout (Envoy serves on its last certs)". It was not.

    tier / target result delta over window
    mesh_dns · echo…aether.internal:18081 http_error +2,329
    mesh_dns · echo…svc.cluster.local:18081 http_error +2,305
    mesh_dns · echo…aether.internal:18081 timeout +212
    mesh_dns · echo…svc.cluster.local:18081 timeout +237
    liveness any 0

    All 5,083 errors came from prober-rw6z8 = main-worker-03; every other node exactly 0.

    Envoy did keep serving on its last certs — that part holds. What breaks is upstream: the fresh
    agent cannot handshake to the registrar without an SVID, logs registry unavailable for initial snapshot; starting with local-only config, and the node's Envoy is left with no cross-node
    endpoints. echo has no replica on w03, so ~95% of that node's mesh_dns probes failed.

    DNS was never implicated — aether_mesh_dns_records = 14 on all five nodes throughout.

    So the exposure is not "SPIRE is down" but "SPIRE is down and that node's agent restarts" —
    precisely the power-failure scenario this issue is about. Worth saying explicitly in the runbook.

    Independently corroborated: AetherProberHTTPErrorBurst CRITICAL fired 19:18:55Z in #alerts.
    No OtelCollectorRefusingData, no EnvoyNotLive; collector refused_metric_points = 0 all
    window, so the SLI was valid rather than blind.

    Finding 2 — the designed taint escalation does not actually hold

    The controller's guard armed the taint correctly at 19:19:38.9Z (29.9s after NotReady — the
    30s grace is right):

    WARN nodetaint/guard.go:135 re-armed agent-not-ready taint: node had no Ready agent pod past grace  node=main-worker-03 grace=30s
    

    …and the agent's own agent-taint-remover removed it ~50ms later:

    INFO node/taint.go:138 removed startup taint  node=main-worker-03 taint=aether.io/agent-not-ready
    

    This repeated every 30s for 8 cycles until recovery. Because SPIRE is deliberately excluded from
    the #667 taint gate, the agent's remover clears a taint the controller armed for a different
    reason. Net effect: the node is tainted ~50ms per 30s — effectively never tainted. The dwell
    reasoning (don't fence out spire-server) is sound; the escalation it is meant to enable does not
    happen. This looks like a design conflict for PR 2, not a tuning knob.

    Finding 3 — mTLS clients stay wedged 2m11s after the SVID lands

    SVID obtained 19:23:11.036Z, svid_ready=1, pod Ready 19:23:14Z — but liveness: failed to re-register endpoint health and failed to start watch stream kept failing with could not get X509 bundle: no SPIRE SVID yet until 19:25:22.0Z. The prober error bleed stopped at the same
    instant (raw counters frozen, identical across two reads 82s apart). Readiness and svid_ready
    therefore overstate recovery by 2m11s. Plausibly the gRPC ClientConn's own reconnect backoff
    (caps ~120s) rather than the app-level retry, whose logged backoff stayed ~1.0–1.2s — hypothesis,
    not measured.

    Timing

    event UTC
    spire-server → 0 19:15:22
    T_del (w03 spire-agent + aether-agent) 19:16:30
    pod Ready, no SVID 19:17:14
    dwell expires, spire-svid failed 19:18:45
    WARN escalation 19:18:58.5
    NotReady 19:19:09
    taint armed (then flaps) 19:19:38.9
    spire-server → 1 19:20:11
    spire-agent attests / Workload API serving 19:22:36 / 19:22:39.5
    SVID obtained (attempt 13, elapsed 391.2s) 19:23:11.0
    pod Ready 19:23:14
    mTLS clients heal, error bleed stops 19:25:22

    Why Tier 2 was not run

    Tier 2 restarts all five agents with SPIRE down. Given Finding 1, that would put every node into
    local-only config simultaneously — a fleet-wide mesh_dns outage on a shared cluster — while
    producing no new information, since the mechanism is per-node and already established. The recipe's
    own gate ("only if Tier 1 is clean") is not satisfied. I'd suggest Tier 2 only after Finding 1 has
    a mitigation, and even then with echo scaled to every node so the blast radius is bounded.

    Verdict

    PARTIAL. #741 does what it set out to do — the agent no longer dies on a cold SPIRE, and every
    assertion about restarts, log ladder, dwell, metrics and registrar deferral holds. But three
    assertions in the PR body do not survive contact with the cluster: the SLI is not flat, the taint
    escalation is defeated by the agent's own remover, and recovery is signalled ~2m before it is real.
    None is a regression introduced by #741 — Findings 2 and 3 are pre-existing interactions this PR is
    the first to expose — but Finding 1 materially changes the operational story and should be
    reflected before this is called done.

    Cluster left as found: spire-server 1/1, spire-agent 5/5, aether-agent 5/5 Ready, 0 restarts
    fleet-wide, no worker taints.

    Not closing — PR 2 pending.

  3. bpalermo commented on Sep 7, 2026

    @bpalermo
    OwnerAuthor

    Re-validation of PR #743 (PR 3) — talos-main rev210 / chart 0.92.11-8310818

    Run 2026-09-07 20:16–20:40Z. Verdict: PASS. Both tiers met every bar. All three findings from the
    #741 run (PARTIAL, rev209) are fixed and measured. Two operational notes at the end.

    Pre-flight: default_x509_svid_ttl: 4h, agents' SVIDs issued ~20:03–20:05Z (>3h50m remaining);
    --spire-wait-warn-after=2m confirmed on the DaemonSet; 0 restarts fleet-wide; no node taints;
    otelcol_receiver_refused_metric_points_total = 0 at every check, so the SLI was valid, not blind.
    GitOps #45 tolerations verified present on spire-agent, spire-server and spire-spiffe-csi-driver.

    echo still has no replica on main-worker-03 (3 replicas: w01/w02/w04) — i.e. the same blast-radius
    precondition that produced the +5,083 in the #741 run.


    TIER 1 — main-worker-03

    T_scale0 20:16:01.4Z · T_del 20:17:01.6Z · recover 20:22:32.2Z · spire-server outage 6m30.8s (budget 10m).
    Agent aether-agent-4dd7s, 0 restarts.

    F1 — the node keeps its data path

    Assertion Result Evidence
    holding xDS until this agent has an SVID every 15s, rising elapsed PASS first at 20:17:10.120Z elapsed=0s; 16 lines, 0s,15s,30s,…,3m45s
    Never registry unavailable for initial snapshot; starting with local-only config PASS grep -c = 0
    xDS socket not opened (Envoy keeps its config) PASS envoy_control_plane_connected_state = 0 on w03 only, 1 on the other four; log stops at invoking pre listen callback with no listen
    envoy_server_live = 1 on w03 throughout PASS 1 at every read; proxy pod 2/2 Running, 0 restarts
    w03 mesh_dns non-success = 0 through the whole outage PASS see table below
    liveness non-success = 0 PASS true zero, control-tested
    After recovery: identity acquired; generating the initial snapshot held=… PASS 20:23:32.262Z, held=6m22.142s

    Raw counters, per prober pod and per path (baseline 20:15:45Z → final 20:26:21Z):

    prober pod / node tier · target result baseline final delta
    prober-rw6z8 / w03 mesh_dns · echo…aether.internal:18081 http_error 2358 2358 0
    prober-rw6z8 / w03 mesh_dns · echo…svc.cluster.local:18081 http_error 2334 2334 0
    prober-rw6z8 / w03 mesh_dns · echo…aether.internal:18081 timeout 215 215 0
    prober-rw6z8 / w03 mesh_dns · echo…svc.cluster.local:18081 timeout 240 240 0
    prober-gbkrr / w05 mesh_dns · both paths http_error / timeout 40/40/4/4 40/40/4/4 0
    prober-67zlb/pcdp4/q6z7r (w01/w04/w02) any any — — no series (0)
    all liveness any non-success — — 0

    Success counters advanced normally across the window — mesh_dns 747,754 → 780,754 (+33,000, 51.9/s)
    and liveness 376,495 → 392,995 (+16,500, 25.9/s) — so the zero is a measured zero, not a dead SLI.

    +5,083 → 0. F1 is fixed.

    F2 — the taint stays armed

    Assertion Result Evidence
    Taint armed ~30s after NotReady PASS NotReady ≈20:19:39Z; re-armed agent-not-ready taint 20:20:09.387Z = 30.0s later
    Taint STAYS until recovery PASS held 20:20:09.4Z → 20:23:33.27Z = 3m03.9s continuously; a 2s-cadence poller recorded exactly two transitions (armed, cleared) — zero flaps vs 8 cycles in #741
    Agent logs the refusal rather than removing it PASS 203× startup taint present but this node cannot mesh a pod; requeueing with socket=true chained=true readyz="spire-svid: no SPIRE SVID after 3m26s (socket …)"
    removed startup taint during the outage PASS 0. The single occurrence is at 20:23:33.266Z, 53ms after readiness passed — i.e. the correct clear-on-recovery

    The remover now reads the same aggregate the kubelet polls, so the two controllers agree. F2 is fixed.

    F3 — recovery means recovery

    spire-agent attested 20:23:21.460Z (grade from here, not the scale command).

    Step UTC Δ
    spire-agent Node attestation was successful 20:23:21.460 —
    identity acquired; generating the initial snapshot held=6m22.142s 20:23:32.262 +10.80s
    identity acquired; reconnecting the registrar client immediately rather than waiting out its backoff 20:23:32.275 +13ms
    last could not get X509 bundle ERROR 20:23:32.277 —
    spire-svid readiness passing (SVID and bundle) 20:23:33.213 attest +11.75s
    watch stream connected (filtered, 10 services) 20:23:33.469 Ready +0.256s
    removed startup taint 20:23:33.266 Ready +53ms
    refreshed clusters from registry 20:23:33.754 Ready +0.54s

    2m11s → 0.256s. F3 is fixed.

    Unchanged assertions

    Assertion Result Evidence
    0 restarts PASS agent 0; fleet-wide 0
    No failed to create SPIRE Workload API source PASS 0 as a log message; 0 FATAL
    Waiting ladder + WARN after 2m PASS 12 attempts, elapsed 10.261s → 349.061s; 6 INFO then WARN from attempt 7 at elapsed 135.346s (> 120s); backoff bounded
    readyz spire-svid ok inside the dwell PASS ok at 20:17:50.8Z (T_del+49s) with no SVID; pod 1/1 Ready
    readyz fails after the dwell PASS [-]spire-svid failed: reason withheld at 20:19:36.4Z
    Reason now reachable in the log PASS (new) WARN 20:19:19.219Z spire-svid readiness failing reason="no SPIRE SVID after 2m9s (socket /run/secrets/workload-spiffe-uds/socket); this workload cannot serve or verify mesh identity"
    svid_ready 1→0→1 PASS w03 only; other four stayed 1
    wait_seconds recorded once PASS count=1, sum=382.395s
    source_restarts absent/0 PASS no series
    controller / registrar / edge spire_svid_ready PASS all 1 throughout (2 registrar, 2 edge, 1 controller)
    aether_mesh_dns_records PASS 14 on all 5 nodes throughout

    TIER 2 — fleet

    T2_scale0 20:29:19.8Z · roll 20:30:20.0Z · turnover 20:30:28.5Z · recover 20:34:34.3Z · outage 5m14.5s.

    Assertion Result Evidence
    Every node holds xDS (5× the holding line) PASS holding lines w01–w05 = 26 / 26 / 26 / 23 / 27; local-only = 0 on all five; failed to create SPIRE Workload API source = 0 on all five
    Envoy keeps serving everywhere PASS envoy_control_plane_connected_state = 0 on all 5 while envoy_server_live = 1 on all 5
    mesh_dns non-success 0 fleet-wide PASS all 8 series byte-identical, baseline 20:28:53.9Z → final 20:39:30.2Z (delta 0)
    liveness non-success 0 PASS true zero, control-tested
    5 nodes NotReady after the dwell PASS all five Ready by 20:30:49 (within dwell), all five NotReady 20:33:07–20:33:10Z
    5 taints ~30s later that STAY PASS 4 armed 20:33:38.2Z, 5th 20:33:40.9Z (≈30s after NotReady); held to recovery; removed startup taint = 0 on all five logs; 26–28 requeue refusals each
    No NoExecute taint PASS all NoSchedule; only other taint on the cluster is main-cp-01 control-plane
    Recreated spire-agent pods scheduled despite the taints (GitOps #45) PASS all 5 Running on their own tainted nodes throughout
    All 5 Ready within ~30s of attestation PASS see below
    Taints cleared PASS all 5 clear by 20:37:10.4Z
    0 restarts fleet-wide PASS agents, proxies, mesh-dns, registrar, controller all 0

    SLI alive: mesh_dns 787,354 → 819,754 (+32,400, 50.9/s); liveness 396,295 → 412,495 (+16,200, 25.5/s).

    Per-node recovery, graded from that node's own spire-agent attestation:

    node attested identity acquired (held=) readiness passing attest → Ready Ready → watch stream Ready → taint cleared
    w01 20:36:38.776 20:37:00.168 (6m22.172s) 20:37:00.763 21.99s 0.60s 0.08s
    w02 20:36:46.030 20:37:06.190 (6m25.706s) 20:37:06.215 20.19s 1.10s 0.26s
    w03 20:36:48.707 20:37:07.833 (6m28.76s) 20:37:07.925 19.22s 1.02s 0.11s
    w04 20:36:15.479 20:36:22.259 (5m43.873s) 20:36:22.311 6.83s 1.04s 0.19s
    w05 20:36:51.282 20:37:09.932 (6m31.199s) 20:37:10.374 19.09s 0.74s 0.07s

    The 19–22s on four nodes is the WaitingSource backoff at its 30s cap, not a defect: w04 happened to
    attest just before a retry and picked up in 6.8s. Post-readiness could not get X509 bundle ERRORs:
    0 on w01/w03/w05; on w02 and w04 exactly one failed to refresh clusters from registry, 154ms and
    10ms after readiness — a single in-flight refresh racing the identity landing, succeeding on the next tick.
    Not the #741 wedge.


    Alerts (#alerts, C0BKTQSPX9T)

    alert fired resolved assessment
    EnvoyControlPlaneDisconnected CRITICAL — main-worker-03 20:22:42Z 20:27:42Z expected consequence of the fix
    EnvoyControlPlaneDisconnected CRITICAL — all 5 workers 20:36:42Z 20:41:42Z same, fleet-wide

    Did NOT fire: AetherProberHTTPErrorBurst (it did fire in the #741 run at 19:18:55Z — its absence is
    independent corroboration that F1 is fixed), EnvoyNotLive, OtelCollectorRefusingData.

    Note that alert absence is not proof of health — there is still no dead-man's switch — but the collector
    refused-points counter was 0 at every check, so the measurements above stand on their own.


    Two operational notes (neither blocks the verdict)

    1. EnvoyControlPlaneDisconnected is now an expected symptom of a SPIRE outage. The xDS hold is a
    disconnected control plane, so this rule fires on every node whose agent restarts while SPIRE is cold. The
    alert's own text already says the right thing ("It keeps running on its last snapshot, so this does NOT show
    up as request failures"), and it resolved on its own within 5 min both times. Worth a runbook line pointing
    at #743 so the next person on-call doesn't chase it; a for: bump or a SPIRE-outage inhibition rule is
    optional.

    2. rollout restart ds/aether-agent cannot execute the Tier 2 recipe. Both DaemonSets are
    maxUnavailable: 1, maxSurge: 0. With SPIRE down, a replaced agent goes NotReady at the dwell, so the
    rollout stalls: 8s after issuing it, exactly 1 of 5 pods had been replaced (aether-agent-qrpqn,
    created 20:30:21Z). I completed the fleet turnover by deleting the remaining aether-agent pods, which is
    also the more faithful model of the power-failure scenario #740 is about. The recipe in the plan comment
    should say "delete the pods" (or temporarily raise maxUnavailable) rather than "rollout restart".


    Caveats

    • A first Tier 1 attempt was aborted by my own scheduling bug: spire-server was down 20:11:45.6Z–20:14:52.0Z
      (3m06s) with no pod deletions, then restored, and the run restarted from a clean re-baseline. That
      aborted window is a useful negative control: prober non-success delta across it was 0 on every series,
      confirming the plan's note that scaling spire-server alone does not reproduce agent: startup is fatally coupled to the SPIRE Workload API — a 25 s SVID wait exits the process (2–4 restarts per node on every cold boot; #662 family) #740 (the local spire-agent
      serves from cache).
    • Tier 2's taint-persistence observation was ~56s, not minutes — recovery ran on a fixed timer to protect
      the 10-minute budget. The load-bearing evidence there is removed startup taint = 0 across all five agent
      logs; Tier 1 independently held the taint for 3m03.9s under a 2s poller.
    • Taint arming landed at T_del+3m07.8s, not the ≈T_del+2m30s the bar estimated. The mechanism is exactly
      as designed; the extra ~38s is kubelet probe latency between the dwell expiring (20:19:19.2Z) and NotReady
      (~20:19:39Z), plus the guard's 30.0s grace. Not a defect, but the estimate in the recipe is optimistic.
    • readyz?verbose still prints spire-svid failed: reason withheld — expected, since controller-runtime
      redacts checker errors; fix(agent): hold xDS, hold the taint, and mean it when identity is ready (#740) #743's fix is the log line, which is present and correct.

    Cluster left as found: spire-server 1/1, spire-agent 5/5 Ready, aether-agent 5/5 Ready, 0 restarts
    fleet-wide, no worker taints, chart 0.92.11-8310818 untouched.

    Not closing — main session decides.

  4. bpalermo commented on Sep 7, 2026

    @bpalermo
    OwnerAuthor

    rev211 (#744) deploy roll, 2026-09-07 20:45–20:49Z — one new race, not yet closed

    Roll itself: 0 restarts, 0 ERROR lines fleet-wide (the #744 INFO/WARN classification fired 0–5× per node instead), controller/registrar/edge svid_ready 1. But mesh_dns http_error +316 on main-worker-02's prober in the 15 s ending 20:48:15Z (≈30 s outage on that node), liveness 0, every other node 0.

    The w02 agent's log shows the mechanism: identity acquired; generating the initial snapshot at 20:47:27.827 → initial snapshot published at 27.828–28.212 with no registry endpoints, because the registrar client's connection was still recovering from its pre-identity handshake failures (reconnecting … immediately at 27.911, registrar has no identity yet; retrying at 27.912 — a misclassification, both registrar pods had been Ready since 20:46:45Z — watch stream connected only at 29.017). The next refresh repaired it ~30 s later. So #743's hold covers "no identity" but the instant identity lands, the initial snapshot races the registrar reconnect and Envoy gets a snapshot without cross-node endpoints. The registry-ready wait in PreListen evidently passed without a first endpoint snapshot.

    PR 5 (in flight): after identity, the initial snapshot waits (bounded, same fallback) for the registry watch to be connected AND the first endpoint snapshot applied; classifier order fixed (own identity → reconnect window → peer identity). Validation bar: a plain rollout restart ds/aether-agent produces 0 http_error on every node.

  5. bpalermo commented on Sep 7, 2026

    @bpalermo
    OwnerAuthor

    Closed: five PRs, validated under a real SPIRE outage on one node and on the fleet, and on plain rolls

    PR what validation
    #741 agent never exits on the Workload API wait; WaitingSource with bounded backoff, INFO→WARN ladder, spire-svid readyz with a 2 m dwell, trust domain late-bound, metrics Tier 1 on w03: 0 restarts through a 6m41s blackout — PARTIAL (three findings)
    #742 controller, registrar, edge on the same helper; webhooks fail open; registrar authorizes nothing until its SVID rev210 baseline clean
    #743 hold xDS while identity is pending (Envoy keeps its config), taint remover defers to the readyz aggregate, readiness = SVID + bundle, immediate registrar reconnect Tier 1 + Tier 2 on rev210: PASS — w03 mesh_dns delta 0 (was +5,083), socket provably closed (connected_state 0, server_live 1), taint held 3m04s, watch connected Ready+0.26 s; fleet: 0 SLI delta, 0 restarts
    #744 Deployments NotReady until identity (dwell is agent-only); client-side classification of a peer without identity rev211 baseline: 0 ERROR fleet-wide
    #746 initial snapshot waits for the registry watch to be connected and endpoints present (the old registryReady was a one-shot latch); classifier keys on local state rev212: deploy roll + 3 agent rolls = 0 mesh_dns / 0 liveness errors on every node, counters byte-identical, 0 restarts

    Plus GitOps #45 (SPIRE workloads tolerate aether.io/agent-not-ready:NoSchedule, the precondition for the readiness dwell) and #745 (runbook: EnvoyControlPlaneDisconnected is the expected symptom of the hold; fleet reproduction deletes agent pods).

    Residual, by design: attestation-to-Ready is bounded by the wait loop's 30 s backoff cap (6.8–22 s measured). Records: project_pr741_validation_20260907, project_pr743_validation_20260907 (memory). spire-server's own aws_kms Fatal on the cluster-hosted OIDC issuer race is k8s-talos-main #44.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions