Repository navigation
feat(agent): TCPRoute/TLSRoute/UDPRoute L4 routing (proposal 018, Phase 3b) - #296
Merged
Merged
Conversation
…se 3b) Add Gateway API L4 route types (parentRef=Service, GAMMA east-west) to the capture listener's TCP floor: - TCPRoute: per-service weighted_clusters tcp_proxy replaces the passthrough floor chain when a TCPRoute attaches to a Service. Multiple rules/backends are flattened into a deduplicated weighted cluster list. - TLSRoute: per-SNI filter chains (filter_chain_match.server_names) are inserted before the per-ClusterIP TCP floor chain on the capture listener. The tls_inspector already present reads SNI; no TLS termination — mesh mTLS stays intact. Chains are also scoped to the service ClusterIP/32 to prevent SNI cross-contamination between services. - UDPRoute: control-plane side (Envoy udp_proxy listener per pod) is implemented; the CNI UDP redirect is explicitly NOT wired. The nftables rule in cni/internal/plugin/capture.go only covers TCP. The listener is generated in the snapshot but receives no traffic until a follow-up CNI change adds: `meta l4proto udp; udp dport <meshPort>; redirect to :<udpCapturePort>`. All three route types are gated behind --l4-routes (default off, separable from --gamma which owns L7). Requires gateway-api v1alpha2 CRDs (TCPRoute/TLSRoute/ UDPRoute are not yet promoted to v1 in gateway-api v1.5.1). L4 route backend services are unioned into the dependency set so their EDS clusters generate. The edge path (TCPRoute/TLSRoute parentRef=Gateway) is a follow-up; this PR scopes to GAMMA east-west. Chart version bumped 0.36 → 0.37; RBAC for tcproutes/tlsroutes/udproutes added under the agent.l4Routes flag. 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
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]>
bpalermo
added a commit
that referenced
this pull request
Jul 2, 2026
…ped (#460) (#463) The 'in progress / not yet shipped' list was fully stale: the TCP-over-mTLS floor (#295/#304), Phase 3b L4 routes (#296), VirtualHost retirement (#292), MCS phase 1, and conformance (both profiles hard-gated) have all landed. Documents the tcp protocol-declaration chain (endpoint.aether.io/protocol -> PROTOCOL_TCP -> aether.io/app-protocol -> /32 floor chain) and the destination-IP-beats-ALPN filter-chain-match gotcha. 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
tcp_proxy.weighted_clusters. All backends across rules are deduplicated and their weights summed. Single-backend case uses the cheaperTcpProxy_Clusterform.filter_chain_match.server_namesfilter chains on the capture listener, inserted before the per-ClusterIP floor chain (tls_inspector already in place). Each rule's SNI set becomes one chain. ClusterIP/32 is also included in the match to prevent cross-service SNI contamination.udp_proxy. The CNI UDP redirect is NOT wired: the nftables rule incni/internal/plugin/capture.goonly redirects TCP. The listener appears in the snapshot but receives no traffic. Follow-up CNI PR needed before this is live. This is explicitly documented inGenerateUDPCaptureListener.Architecture
Gate:
--l4-routes(default off, independent of--gamma). Requires--transparent-captureto be meaningful.Route types live in gateway-api
v1alpha2(TCPRoute/TLSRoute/UDPRoute are not yet promoted to v1 in gateway-api v1.5.1). Thegatewayv1alpha2.Install(scheme)call registers them.Filter chain order on the capture listener (most-specific first):
server_names + prefix_ranges=/32(proposal 018 Phase 3b)prefix_ranges=/32only (Phase 3a/3b)Backend services from L4 routes are unioned into the dependency set so their EDS clusters generate.
Edge path
TCPRoute/TLSRoute parentRef=Gateway (edge) is a follow-up — scoped out here.
New files
agent/internal/xds/proxy/l4route.goagent/internal/xds/proxy/l4route_test.goagent/internal/l4route/reconciler.goagent/internal/l4route/reconciler_test.goagent/internal/xds/cache/l4route.goTest plan
bazel build //agent/...cleanbazel test //agent/...— 20/20 pass (includingproxy_test,l4route_test,cache_test)bazel test //charts/...— 6/6 pass (chart lint + template tests)bazel build --config=lint //agent/...cleanmake format— no driftOpen risks for e2e
listener_filter_timeoutpath — if the TLS ClientHello is fragmented, there can be a brief delay. Not new; the tls_inspector was already in the Phase 3a listener.--gammaand--l4-routesare both set,gatewayv1.Installandgatewayv1alpha2.Installare called once each. The scheme registration is idempotent so there is no conflict, but the two calls are independent.🤖 Generated with Claude Code
https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S