Skip to content

feat(edge): agent edge subcommand — single-identity north-south ingress control plane - #236

Merged
bpalermo merged 1 commit into
mainfrom
feat/edge-proxy-control-plane
Jun 19, 2026
Merged

bpalermo merged 1 commit into
mainfrom
feat/edge-proxy-control-plane

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

What

PR1 of the edge proxy (north-south ingress) plan: an agent edge subcommand that runs a single-identity ingress control plane dialing mesh pods directly over mTLS — no node proxy / DaemonSet in the path.

The transport migration (#98–#101) already made node-proxy egress a plain per-source mTLS HTTP/2 client to pod_ip:15008, with each destination pod's own netns-bound inbound listener terminating mTLS and recording the caller in XFCC. The edge is the same path with one identity instead of many, so the node data plane is unchanged — inbound listeners already accept any trust-domain peer.

Highlights

  • runEdge — subtractive variant of runAgent: controller-runtime manager hosting only the xDS server + registry refresher. No CNI server, no per-pod storage logic, no SPIRE bridge. Shared identity/registrar/SPIRE flags extracted into registerSharedFlags so the node path is untouched (node-only flags like --spire-admin-socket/--mounted-registry-dir stay off edge).
  • Envoy → SPIRE SDS directly — the edge's single SVID + trust bundle are fetched over a static spire_agent gRPC SDS cluster (config.SDSConfigSourceFromCluster + proxy.EdgeUpstreamTransportSocket), not the agent's ADS stream. The agent runs no SPIRE bridge in edge mode. SAN pinning (feat(proxy): pin upstream peer identity to the service's SPIFFE IDs #165/feat(proxy): multi-key subset selection #166) is preserved — match_typed_subject_alt_names is inline, only the bundle comes over SDS.
  • Edge data plane — proxy.BuildEdgeListener (0.0.0.0:8080, RDS, readiness health_check filter ahead of the router), proxy.BuildEdgeRouteConfiguration (exposed vhosts + 404 catch-all, no ODCDS catch-all), and NewServiceCluster gains a perDownstreamConnectionPool flag so the single-identity edge fully multiplexes upstream connections.
  • Snapshot cache edge mode — SetEdgeMode/SetEdgeIdentity/SetStaticDependencies, with edge branches in Listeners(), clustersEndpointsAndVhosts, and generateSnapshot. The static dependency set scopes the registrar watch to exactly the exposed services.
  • Exposure is seeded from --expose for now; a follow-up PR swaps in an EdgeRoute CRD watch.

Tests

Unit tests cover the edge transport socket (SDS source = spire_agent, SAN pinning), edge listener, edge route config, the SDS config-source helper, the static dependency seam, and edge-mode listener composition. All existing NewServiceCluster callers updated to preserve node behavior (true).

bazel build //..., bazel test //agent/... //registry/... --test_arg=-test.short (17/17), and --config=lint all pass.

Follow-ups (per the approved plan)

  • PR2: EdgeRoute CRD (config.aether.io/v1) + live watch → replaces --expose, drives external-host vhosts.
  • PR3: edge chart (edge.enabled in charts/aether; bootstrap defining the spire_agent SDS cluster).
  • PR4: downstream TLS termination.
  • PR5: talos e2e.

🤖 Generated with Claude Code

…ss control plane

Add `agent edge`, a subtractive control-plane mode for an edge (north-south
ingress) proxy that dials mesh pods directly over mTLS — no node proxy/DaemonSet
in the path. The transport migration (#98-#101) already made node egress a plain
per-source mTLS HTTP/2 client to pod_ip:15008, so the edge is the same path with
a single identity instead of many; the node data plane is unchanged.

- `runEdge`: controller-runtime manager hosting only the xDS server + registry
  refresher (no CNI server, no per-pod storage, no SPIRE bridge). Shared
  identity/registrar/SPIRE flags extracted into registerSharedFlags so the node
  path is untouched.
- Envoy fetches its single SVID + trust bundle straight from SPIRE over a static
  spire_agent gRPC SDS cluster (config.SDSConfigSourceFromCluster +
  proxy.EdgeUpstreamTransportSocket), not the agent's ADS stream. SAN pinning is
  preserved (inline matchers over the SDS bundle).
- Edge data plane: BuildEdgeListener (0.0.0.0:8080, RDS, readiness filter ahead
  of the router), BuildEdgeRouteConfiguration (exposed vhosts + 404 catch-all, no
  ODCDS), and NewServiceCluster gains a perDownstreamConnectionPool flag so the
  single-identity edge multiplexes upstream connections.
- Snapshot cache edge mode: SetEdgeMode/SetEdgeIdentity/SetStaticDependencies;
  the static dependency set scopes the registrar watch to exactly the exposed
  services. Exposure is seeded from --expose for now; an EdgeRoute CRD watch
  replaces it in a follow-up.

Unit tests cover the edge transport socket, listener, route config, SDS config
source, static dependency seam, and edge-mode listener composition.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pihqn5RmVPhV9HTdBnqbvY
@bpalermo
bpalermo merged commit 74a2a2a into main Jun 19, 2026
14 checks passed
@bpalermo
bpalermo deleted the feat/edge-proxy-control-plane branch June 19, 2026 15:45
bpalermo added a commit that referenced this pull request Jun 19, 2026
…eRoutes

Add the edge-proxy proposal doc reflecting what shipped across #236–#239
(single-identity agent edge control plane, Envoy-talks-SPIRE-SDS-directly, the
EdgeRoute CRD, the edge.enabled chart, downstream TLS), resolving the
docs/proposals/003_edge-proxy.md references already in the code/chart comments.

Also adds test/e2e/edge: a manual talos-main runbook (enable the edge, expose a
service, drive traffic, assert direct-to-pod + edge identity in XFCC + hitless
rollout + live route changes) and example EdgeRoute manifests (host-based and
multi-port).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pihqn5RmVPhV9HTdBnqbvY
bpalermo added a commit that referenced this pull request Jun 19, 2026
…eRoutes

Add the edge-proxy proposal doc reflecting what shipped across #236–#239
(single-identity agent edge control plane, Envoy-talks-SPIRE-SDS-directly, the
EdgeRoute CRD, the edge.enabled chart, downstream TLS), resolving the
docs/proposals/003_edge-proxy.md references already in the code/chart comments.

Also adds test/e2e/edge: a manual talos-main runbook (enable the edge, expose a
service, drive traffic, assert direct-to-pod + edge identity in XFCC + hitless
rollout + live route changes) and example EdgeRoute manifests (host-based and
multi-port).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pihqn5RmVPhV9HTdBnqbvY
bpalermo added a commit that referenced this pull request Jun 19, 2026
…eRoutes (#240)

* docs(edge): proposal 003 (as-built) + talos e2e runbook + example EdgeRoutes

Add the edge-proxy proposal doc reflecting what shipped across #236–#239
(single-identity agent edge control plane, Envoy-talks-SPIRE-SDS-directly, the
EdgeRoute CRD, the edge.enabled chart, downstream TLS), resolving the
docs/proposals/003_edge-proxy.md references already in the code/chart comments.

Also adds test/e2e/edge: a manual talos-main runbook (enable the edge, expose a
service, drive traffic, assert direct-to-pod + edge identity in XFCC + hitless
rollout + live route changes) and example EdgeRoute manifests (host-based and
multi-port).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pihqn5RmVPhV9HTdBnqbvY

* docs(edge): correct exposure wording — external host only, no mesh FQDN, no --expose

Align the proposal doc and e2e assets with the routing fix (#241): the edge routes
ONLY by explicit external host; the internal mesh FQDN is not an edge entrypoint
and `hosts` is required. Drop the removed `--expose` seed from the doc, runbook,
and example.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pihqn5RmVPhV9HTdBnqbvY

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
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