Repository navigation
feat(agent): port-qualified L4 route backends (037 Phase 3) - #897
Merged
Merged
Conversation
A TCPRoute/TLSRoute backendRef naming a specific raw-TCP port now resolves to that port's cluster. common/l4project's ClusterNameFunc takes the backendRef's port. It was documented as "NOT port-qualified" because the TCP floor addressed one port per service and a port had nothing to select. Now that a service can carry several raw-TCP ports, ignoring it would silently send a route for :5432 to whatever the floor forwards to -- a misroute with no error anywhere. A ref with no port yields 0 and the service's default floor cluster, which is what every route written before this change resolves to. The cache now publishes tcp:<fqdn>:<port> for EVERY TCP port, not only the non-primary ones. The primary's is an ALIAS: same EDS as the floor and NO SNI, because the destination's default inbound chain serves it and a non-empty SNI would route it to a per-port chain that does not exist (#306). Without that alias a backendRef naming the primary port would resolve to a cluster that is not in the snapshot, and tcp_proxy would kill those connections silently -- the same Risk 1 shape as a chain without a cluster, reached from the other end. UDP deliberately keeps ignoring the port: the UDP floor already addresses backends by their registered application port (proposal 018 Phase 3b), and 037 is a TCP/HTTP change. The parameter is accepted and dropped so the signature is shared; unifying the two is a later proposal's job. Negative control: ignoring backendRef.port -- the pre-Phase-3 behaviour -- fails the port-qualified case while the no-port case still passes, which is the split that matters for the rollout: every existing route is in the second. NOT included: the GAMMA projector rejecting an HTTPRoute backendRef.port that resolves to a TCP port (ResolvedRefs=False / UnsupportedProtocol). The proposal lists it as an open question because ProjectHTTPRule also runs in the registrar's config-export controller, where there are no endpoints to classify against. The agent's cache already declines to build an h2 cluster for a TCP port, so such a route 503s rather than misrouting -- loud, but late. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
3 tasks
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.
Proposal 037 Phase 3. Follows #895 (Phase 2 Release B, deployed to talos-main as rev233).
A TCPRoute/TLSRoute
backendRefnaming a specific raw-TCP port now resolves to that port's cluster.What changed
common/l4project'sClusterNameFunctakes the backendRef's port. It was documented as "NOT port-qualified" because the TCP floor addressed one port per service and a port had nothing to select. Now that a service can carry several raw-TCP ports, ignoring it would silently send a route for:5432to whatever the floor forwards to — a misroute with no error anywhere.A ref with no port yields 0 and the service's default floor cluster: what every route written before this change resolves to.
The alias that makes the namer total
The cache now publishes
tcp:<fqdn>:<port>for every TCP port, not only the non-primary ones. The primary's is an alias — same EDS as the floor, and no SNI, because the destination's default inbound chain serves it and a non-empty SNI would route it to a per-port chain that doesn't exist (#306).Without that alias, a
backendRefnaming the primary port would resolve to a cluster absent from the snapshot, andtcp_proxywould kill those connections silently — the same Risk 1 shape as a chain without a cluster, reached from the other end. That's the third time this proposal's hazard has been an incomplete increment rather than a wrong line.UDP deliberately unchanged
The UDP floor already addresses backends by their registered application port (proposal 018 Phase 3b), and 037 is a TCP/HTTP change. The parameter is accepted and dropped so the signature is shared; unifying the two is a later proposal's job.
Negative control
Ignoring
backendRef.port— the pre-Phase-3 behaviour — fails the port-qualified case while the no-port case still passes. That split is what matters for the rollout: every existing route is in the second.bazel build //...clean, 109 tests pass, lint clean.Not included, and why
The GAMMA projector rejecting an HTTPRoute
backendRef.portthat resolves to a TCP port (ResolvedRefs=False/UnsupportedProtocol). The proposal lists this as an open question:ProjectHTTPRulealso runs in the registrar's config-export controller, where there are no endpoints to classify against, so the projector cannot see the protocol from there.The agent's cache already declines to build an h2 cluster for a TCP port, so such a route 503s rather than misrouting — loud, but late. Resolving it properly needs the protocol threaded through 026's export path, which is its own change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr