Repository navigation
Conversation
Implements proposal 018 Phase 3a: a TCP passthrough path alongside the existing HTTP/gRPC HCM path for transparent capture. Non-HTTP services get per-ClusterIP tcp_proxy floor chains on the outbound capture listener (prefix_ranges /32 match) and the inbound :15008 listener gains an ALPN-demuxed TCP floor chain (application_protocols: ["aether-tcp"]) so source-proxy TCP connections bypass the HCM entirely and are forwarded directly to the pod's app cluster over SPIRE mTLS with SPIFFE SAN pinning. HTTP services are intentionally excluded to avoid filter-chain precedence conflicts (destination-IP > application-protocol). - common/constants: AnnotationMeshAppProtocol annotation for registry-generated Services - registrar/services: generator writes "http" annotation on all PROTOCOL_HTTP services - capture/reconciler: SetCaptureTCPServices — projects non-HTTP services to the cache - proxy/capture: tls_inspector listener filter, buildCaptureTCPFloorFilterChain, AetherTCPALPN constant, CaptureTCPService proxy-layer type - proxy/ingress: buildInboundTCPFloorFilterChain (ALPN match → tcp_proxy → app cluster) - proxy/networkfilter: buildTCPProxyNetworkFilter helper - proxy/egress: TCPClusterName, NewTCPServiceCluster, InjectUpstreamTCPMTLS - proxy/transportsocket: UpstreamTCPTransportSocket (ALPN "aether-tcp" override) - proxy/transportsocketmatch: UpstreamTCPTransportSocketMatches - cache: captureTCPClusters, SetCaptureTCPServices (with live per-pod listener rebuild), cniPod stored in listenerEntry for regeneration on TCP-service set changes Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S
Owner
Author
|
Superseded by #295 (integrated with MCS phase-1). Work preserved there. |
bpalermo
added a commit
that referenced
this pull request
Jun 24, 2026
PR #294 (TCP-over-mTLS floor) and #296 (TCPRoute/TLSRoute/UDPRoute L4 routing) were both unreachable because the service model was HTTP-only: a workload could never be classified as TCP. This lets a workload be registered and generated as a PROTOCOL_TCP service so the capture TCP floor and L4 routes become reachable and e2e-testable. - proto: add Service.Protocol PROTOCOL_TCP = 2. - registration (registry/cni.go): pick the protocol from the new endpoint.aether.io/protocol pod annotation (default "http"; "tcp" => PROTOCOL_TCP; unknown values rejected). - generator: project PROTOCOL_TCP services into selectorless mesh Services annotated aether.io/app-protocol=tcp (the agent capture reconciler's TCP-floor signal); one mesh Service per name, HTTP claimed first. - registrar snapshot/sync/server: list + sync every protocol; supersede write-behind unregisters across protocols. - agent watch cache (RegistrarRegistry): partition the watch-fed cache by protocol so ListAllEndpoints(protocol) returns only that protocol's services; ListAllEndpoints now gates on watch readiness (not a non-empty partition) so an empty protocol returns the truthful empty set. - agent EDS (cache/cluster.go): build TCP service cluster entries holding the bare-name EDS load assignment (+ SAN/sni) that the floor's "tcp:<svc>.<domain>" cluster references; no HTTP h2 cluster/vhost is emitted for a TCP service. - ghost sweep: reconcile both protocols so TCP endpoints aren't ghost-pruned. Operator marks a workload TCP with the pod annotation: endpoint.aether.io/protocol: tcp Adds unit tests: registration picks TCP from the annotation; the generator emits a tcp-annotated mesh Service; the agent builds a tcp:<svc> cluster with EDS endpoints. HTTP behavior is unchanged (default is HTTP). Claude-Session: https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S 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.
Summary
Implements proposal 018 Phase 3a: transparent L4 passthrough for non-HTTP services over per-source SPIRE mTLS with SPIFFE SAN pinning. HTTP/gRPC traffic continues through the HCM path unchanged.
Data-plane design
Outbound (capture listener per pod)
tls_inspectorlistener filter added alongsidehttp_inspector(enables ALPN reading)tcp_proxyfilter chain matched onprefix_ranges: [ClusterIP/32]"aether-tcp"on its upstream transport socketInbound (:15008 per pod)
application_protocols: ["aether-tcp"]prepended before the HCM chainsapp_<pod>_<port>cluster; terminates mTLS (SPIRE SDS)TCP clusters
tcp:<service>.<meshDomain>EDS clusters — no h2 protocol options, ALPN"aether-tcp"on transport socketcaptureTCPClusters(), emitted only when capture is enabledAnnotation flow
AnnotationMeshAppProtocolon generated mesh Services ("http"for all current PROTOCOL_HTTP services)SetCaptureTCPServicescniPodinlistenerEntryso per-pod capture listeners are regenerated in-place when the TCP service set changesWhat is NOT changed
--capture-enabledTest plan
TestGenerateCaptureListener— tls_inspector present, no TCP chains when no TCP servicesTestGenerateCaptureListener_WithTCPServices— 2 TCP floor chains + HCM catch-all, correct /32 prefix matchesTestGenerateCaptureListener_InvalidTCPService— bad/empty ClusterIPs silently skippedTestInboundTCPFloorFilterChain— ALPN match, tcp_proxy → app cluster, mTLS transport socketTestNewInboundListenerupdated — TCP floor chain now at index 0, HCM at index 1TestIsHTTPAppProtocol— all HTTP-family variants true; tcp/ws/grpc-web falseTestReconcile_ProjectsTCPServices— only non-headless TCP services produce entriesTestGenerator_AnnotatesHTTPAppProtocol— PROTOCOL_HTTP services get"http"annotationTestGenerator_UpdatesStaleAppProtocol— stale annotation corrected on reconcilebazel test //agent/... //registrar/... --test_arg=-test.short)🤖 Generated with Claude Code
https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S