Skip to content

docs: proposal 034 — UDS support for pods - #134

Merged
bpalermo merged 3 commits into
mainfrom
docs/uds-support-proposal
Aug 1, 2026
Merged

bpalermo merged 3 commits into
mainfrom
docs/uds-support-proposal

Conversation

@bpalermo

@bpalermo bpalermo commented Jun 11, 2026 •

Copy link
Copy Markdown
Owner

Design proposal 034: UDS support for pods, both directions, phased.

  • Phase 1 (inbound): apps serving on a Unix domain socket join the mesh via endpoint.aether.io/uds-socket: <volume>/<file>. The per-(pod, port) app_<pod>_<port> and health_<pod> clusters dial the socket as an Envoy Pipe address (no UpstreamBindConfig — UDS is mount-namespace-scoped). endpoint.aether.io/port(s) stays required: ports name the service ports for inbound demux and EDS; the annotation only changes what the app cluster dials, and one socket serves all declared ports. The inbound mTLS listener and registry/EDS endpoints stay TCP pod_ip:18008, so a UDS pod is indistinguishable from a TCP pod to every client — same node, cross-node, cross-cluster, through the E/W waypoint, and under the SPIRE-off cleartext inbound.
  • Phase 2 (outbound): apps dial the mesh through a per-pod egress.aether.io/socket UDS listener — a filesystem-permissioned, capture-independent entry with native unix:// gRPC targets, additive to 127.0.0.1:18081. With redirect-all and mesh DNS as the default path, this serves a narrower audience (capture-opt-out pods, unix://-native clients); it ships only after Phase 1 proves demand, behind a hot-restart pipe-inheritance spike.

Core mechanism: pathname UDS lives in the mount namespace, so the bridge is kubelet's pod-volumes dir — a socket in a workload emptyDir is host-visible at /var/lib/kubelet/pods/<UID>/volumes/kubernetes.io~empty-dir/<vol>/<file>. The proxy DaemonSet mounts that hostPath at the identical container path (HostToContainer, not readOnly — connect(2) on AF_UNIX needs write permission on the socket inode, so an RO mount fails EROFS even for root), gated by proxy.udsWorkloads.enabled. Abstract-namespace sockets, workload hostPath mounts, and proxy-shared emptyDirs are evaluated and rejected in the doc (the last works intra-pod only — the #499 authz socket — never cross-pod).

Shared plumbing (PR 1 of 5): CNIPod.uid = 11 — the CNI server already fetches the Pod UID for SPIRE selectors but drops it; persisting it in storage lets listener replay resolve pipe paths without the API server — plus a traversal-rejecting annotation→host-path resolver behind a --kubelet-pods-dir flag.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR

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]>
bpalermo and others added 2 commits August 1, 2026 17:43
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 bpalermo changed the title docs: proposal 002 — UDS support for pods docs: proposal 034 — UDS support for pods Aug 1, 2026
@bpalermo
bpalermo merged commit 89c0af9 into main Aug 1, 2026
15 checks passed
@bpalermo
bpalermo deleted the docs/uds-support-proposal branch August 1, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant