Repository navigation
fix(chart): bind OPA sidecar API to a per-pod UDS to end the 8181 host-port bind race - #499
Merged
Merged
Conversation
…t-port bind race The OPA authz sidecar (proposal 027 preset) ran its diagnostic API on `--addr=127.0.0.1:8181`. But the proxy DaemonSet is `hostNetwork: true`, so 127.0.0.1:8181 is a HOST-wide port, and the rollout uses `maxSurge=1, maxUnavailable=0` (intentional — the new Envoy hot-restarts from the old across the pod boundary). During every proxy roll the old and surged-in new pod run simultaneously on the same node and both OPA sidecars try to bind the same host 8181 → the new one crashloops with `listen tcp 127.0.0.1:8181: bind: address already in use` until the old pod exits. Result: a deterministic 2-3 restart warm-up on every proxy roll (and at install, which is also a roll). Nothing consumes 8181 — Envoy reaches OPA only over the ext_authz gRPC UDS (authz.sock). Move OPA's API onto a per-pod UDS in the (per-pod) authz-socket emptyDir so there is no host port to collide on. Surge/hot-restart is unchanged. Observed in the 2026-07-10 8h churn soak: benign for the data plane (maxUnavailable=0 + surge keeps the old pod serving until the new one is Ready), but it stalls roll completion ~2-3 min and is noise. This removes it. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S
bpalermo
added a commit
that referenced
this pull request
Aug 1, 2026
Renumber 002 -> 034 (002 is taken by the merged agent-concurrency audit) and revise every code reference after two months of drift: - Ports post-030: inbound is 18008 (defaultInboundPort); the outbound listener is unchanged at 18081 (mesh.ProxyOutboundPort) - Multi-port routing (005): delivery is app_<pod>_<port>, so the original "port is ignored for delivery" semantic is REVERSED — port(s) stay required for demux/EDS; the annotation only changes what the app cluster dials (one socket serves all declared ports) - Redirect-all (022) + mesh DNS narrowed Phase 2's audience; keep it, priority lowered, re-evaluate after Phase 1 - E/W waypoint (019) and cleartext inbound (#421) confirmed covered for free (delivery sits behind the inbound listener) - New facts folded in: UID already fetched but deliberately not persisted (resubscribe.go), storage is protojson in agent/storage, builder is exported GenerateOutboundHTTPListener with the 025/#470 extension union (hoisted per-loop in #615), authz emptyDir socket (#499) documented as the intra-pod precedent (cross-pod still needs the kubelet hostPath), RESULT_IGNORED unmanaged pods, TCP connect-probe analogue on pipes - New constraint: the kubelet-pods mount must not be readOnly (connect(2) on AF_UNIX needs write on the inode; EROFS otherwise) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR
bpalermo
added a commit
that referenced
this pull request
Aug 1, 2026
* docs: proposal 002 — UDS support for pods Plan for letting pods serve on and dial the mesh via Unix domain sockets, in two phases (inbound first). Pathname UDS is mount-namespace-scoped, so the design bridges pod emptyDir volumes to the node proxy through kubelet's pod-volumes directory; abstract sockets and workload hostPath mounts are evaluated and rejected. Registry/EDS endpoints stay TCP :15008, so UDS pods are indistinguishable from TCP pods to clients. Co-Authored-By: Claude Opus 4.8 <[email protected]> * docs(034): re-ground the pod-UDS proposal in the current codebase Renumber 002 -> 034 (002 is taken by the merged agent-concurrency audit) and revise every code reference after two months of drift: - Ports post-030: inbound is 18008 (defaultInboundPort); the outbound listener is unchanged at 18081 (mesh.ProxyOutboundPort) - Multi-port routing (005): delivery is app_<pod>_<port>, so the original "port is ignored for delivery" semantic is REVERSED — port(s) stay required for demux/EDS; the annotation only changes what the app cluster dials (one socket serves all declared ports) - Redirect-all (022) + mesh DNS narrowed Phase 2's audience; keep it, priority lowered, re-evaluate after Phase 1 - E/W waypoint (019) and cleartext inbound (#421) confirmed covered for free (delivery sits behind the inbound listener) - New facts folded in: UID already fetched but deliberately not persisted (resubscribe.go), storage is protojson in agent/storage, builder is exported GenerateOutboundHTTPListener with the 025/#470 extension union (hoisted per-loop in #615), authz emptyDir socket (#499) documented as the intra-pod precedent (cross-pod still needs the kubelet hostPath), RESULT_IGNORED unmanaged pods, TCP connect-probe analogue on pipes - New constraint: the kubelet-pods mount must not be readOnly (connect(2) on AF_UNIX needs write on the inode; EROFS otherwise) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
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.
Problem
The OPA authz sidecar (proposal 027 preset) crashloops 2-3 times on every proxy roll (and at install) with:
Root cause
hostNetwork: true→127.0.0.1:8181is a host-wide port, not pod-local.maxSurge=1, maxUnavailable=0(intentional — the new Envoy hot-restarts from the old across the pod boundary), so during every roll the old and new proxy pod run simultaneously on the same node.8181→ the new one can't until the old pod fully exits → deterministic 2-3 restart bind race.8181is OPA's diagnostic HTTP API, which nothing here consumes — Envoy reaches OPA only over the ext_authz gRPC UDS (authz.sock).Fix
Bind OPA's API to a per-pod UDS in the (per-pod)
authz-socketemptyDir:No host port → no cross-pod collision. Surge / hot-restart is untouched, and the ext_authz gRPC path is already a UDS.
Alternatives rejected
maxSurge=0— kills the collision but breaks the hitless hot-restart handoff (the surge is load-bearing).SO_REUSEADDR— OPA doesn't expose it, and it wouldn't help across two distinct processes anyway.Scope
8181appeared only in this one template. The edge OPA sidecar is a normal Deployment (not hostNetwork), so it has no host-port collision — no change needed.Validation
helm lintclean; template renders the UDS addr.maxUnavailable=0+surge keeping the old pod serving, but it stalls roll completion ~2-3 min). Post-merge: rollds/aether-proxyon talos and confirm the authz sidecar comes up with 0 restarts.Chart bumped
0.71.0→0.72.0.🤖 Generated with Claude Code