Repository navigation
feat(agent): tunnel-client xDS generators (R2 PR 4/6) - #86
Merged
Merged
Conversation
Round 2 (PR 4/6): add the proven HBONE-style tunnel-client generators as reusable proxy functions, ahead of wiring them into the outbound <C> cluster: - NewTunnelInternalListener: the internal listener whose tcp_proxy encapsulates a stream into a CONNECT tunnel, setting the CONNECT :authority from the destination pod address carried in the passed-through tunnel metadata (%DYNAMIC_METADATA(tunnel:authority)%). - NewTunnelOriginateCluster: the ORIGINAL_DST cluster the tunnel dials, reading the destination node address per-endpoint from tunnel.node (metadata_key). connection_pool_per_downstream_connection guarantees a source pod's tunnel connection is never reused for another source, so the per-source client cert (selected by the #80 transport-socket matcher on the source netns filter state, on-no-match -> node identity) cannot leak across identities — the leak-free path validated in the identity spike. - InternalUpstreamTransportSocket: passes the selected endpoint's tunnel metadata across the internal-listener boundary. - TunnelEndpointMetadata: builds endpoint metadata (envoy.lb subset keys + tunnel.authority/node). Pure generators with unit tests; not yet wired into cluster/EDS generation, so no behavior change. The <C> rewire + node_ip plumbing follows in the next stacked PR. Co-Authored-By: Claude Opus 4.8 <[email protected]>
bpalermo
force-pushed
the
feat/r2-tunnel-client-generators
branch
from
June 8, 2026 15:04
4618a29 to
77f2a3b
Compare
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.
Stack
main) ← base<C>rewire +node_ipEDS wiringWhat
The proven HBONE tunnel-client mechanics, as reusable proxy generators (from the validated
client_v6/client_idspike configs):NewTunnelInternalListener— internal listener whosetcp_proxyencapsulates a stream into a CONNECT tunnel, CONNECT:authoritytemplated from the passed-throughtunnel.authoritymetadata.NewTunnelOriginateCluster—ORIGINAL_DSTcluster reading the dest node address per-endpoint fromtunnel.node(metadata_key).connection_pool_per_downstream_connectionguarantees a source pod's tunnel connection is never reused for another source, so the per-source client cert (the feat(agent): upstream cluster mTLS via transport-socket matcher #80 matcher on the source netns filter-state, on-no-match → node identity for health-check tunnels) cannot leak across identities — the leak-free path proven in the identity spike.InternalUpstreamTransportSocket— passes the selected endpoint's tunnel metadata across the internal-listener boundary.TunnelEndpointMetadata— endpoint metadata (envoy.lbsubset keys +tunnel.authority/node).Safety
Pure generators with unit tests — not yet wired into cluster/EDS generation, so no behavior change. The
<C>rewire +node_ipplumbing (each agent stamps its own node IP at registration) follows in PR 6.Tests
New
tunnel_test(listener, originate cluster incl. ORIGINAL_DST/metadata_key/per-downstream-pool/on-no-match, internal_upstream, endpoint metadata); full agent suite (12/12) passes.🤖 Generated with Claude Code