Skip to content

feat(agent): tunnel-client xDS generators (R2 PR 4/6) - #86

Merged
bpalermo merged 1 commit into
mainfrom
feat/r2-tunnel-client-generators
Jun 8, 2026
Merged

bpalermo merged 1 commit into
mainfrom
feat/r2-tunnel-client-generators

Conversation

@bpalermo

@bpalermo bpalermo commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Stack

Targets feat/r2-dest-connect-listener; rebase onto main once #85 merges.

What

The proven HBONE tunnel-client mechanics, as reusable proxy generators (from the validated client_v6/client_id spike configs):

  • NewTunnelInternalListener — internal listener whose tcp_proxy encapsulates a stream into a CONNECT tunnel, CONNECT :authority templated from the passed-through tunnel.authority metadata.
  • NewTunnelOriginateCluster — ORIGINAL_DST cluster reading the dest 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 (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.lb subset 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_ip plumbing (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

Base automatically changed from feat/r2-dest-connect-listener to main June 8, 2026 15:03
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
bpalermo force-pushed the feat/r2-tunnel-client-generators branch from 4618a29 to 77f2a3b Compare June 8, 2026 15:04
@bpalermo
bpalermo merged commit 3a15939 into main Jun 8, 2026
10 checks passed
@bpalermo
bpalermo deleted the feat/r2-tunnel-client-generators branch June 8, 2026 15:14
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