Skip to content

feat(edge): downstream TLS termination from a Kubernetes TLS Secret - #239

Merged
bpalermo merged 1 commit into
mainfrom
feat/edge-tls
Jun 19, 2026
Merged

bpalermo merged 1 commit into
mainfrom
feat/edge-tls

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

What

PR4 of the edge proxy plan (stacked on #238). Lets the edge listener terminate external (north-south) TLS from a mounted Kubernetes TLS Secret. The edge→pod upstream hop stays mTLS either way — only the external client→edge leg gains TLS.

Base is feat/edge-chart (#238); review after that merges. The diff here is just the TLS delta.

Changes

  • proxy — BuildEdgeListener takes an optional *EdgeTLS{CertPath, KeyPath}. When set, the filter chain gets a DownstreamTlsContext serving those files and does not require a client certificate (external callers have no mesh identity). The cert is mounted as files (no SDS); rotating the Secret takes effect on the next edge pod roll.
  • cache — SetEdgeTLS stores the cert/key paths; Listeners() passes them through in edge mode.
  • agent — agent edge gains --edge-tls-cert-file / --edge-tls-key-file.
  • chart — edge.tls.{enabled,secretName,mountPath} mounts the Secret into the Envoy container, passes the flags, switches the readiness probe to scheme: HTTPS, and requireds secretName when enabled. Chart 0.7.0 → 0.8.0.

Tests

Unit tests cover the TLS and plain-HTTP listener variants (transport socket present/absent, no client-cert requirement, file paths). helm template renders both ways; the secretName guard errors when missing. Build, full proxy/cache/cmd tests, lint, and format pass.

Follow-up

  • PR5: talos e2e.

🤖 Generated with Claude Code

Base automatically changed from feat/edge-chart to main June 19, 2026 16:14
Let the edge listener terminate external (north-south) TLS from a mounted k8s TLS
Secret. The edge->pod upstream hop stays mTLS either way; only the external
client->edge leg gains TLS.

- proxy: BuildEdgeListener takes an optional *EdgeTLS (cert/key file paths). When
  set, the filter chain gets a DownstreamTlsContext serving those files; it does
  NOT require a client certificate (external callers have no mesh identity). Cert
  is mounted as files (no SDS) — rotating the Secret takes effect on the next edge
  pod roll.
- cache: SetEdgeTLS stores the cert/key paths; Listeners() passes them through in
  edge mode.
- agent: `agent edge` gains --edge-tls-cert-file/--edge-tls-key-file.
- chart: edge.tls.{enabled,secretName,mountPath} mounts the Secret into the Envoy
  container, passes the flags, sets the readiness probe scheme to HTTPS, and
  requires secretName when enabled. aether chart 0.7.0 -> 0.8.0.

Tests cover the TLS and plain-HTTP listener variants. Renders both ways; the
secretName guard fires when missing.

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
bpalermo merged commit 70c9f9a into main Jun 19, 2026
14 checks passed
@bpalermo
bpalermo deleted the feat/edge-tls branch June 19, 2026 16:21
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]>
bpalermo added a commit that referenced this pull request Jun 19, 2026
…ct (#244)

Replace the v1 file-mounted single-cert edge TLS (#239) with real ingress TLS:
per-host certs, hot rotation, and an HTTP->HTTPS redirect.

- EdgeRoute.spec.tls{secret_name, provider} references a cert (BYO / cert-manager).
  provider is a SecretProvider ENUM (kubernetes now; aws-secrets-manager reserved).
- New agent/internal/edge/secret: a pluggable Provider interface + Registry
  (enum dispatch, provider-prefixed SDS names "<scheme>/<ref>"); kubernetesProvider
  reads a kubernetes.io/tls Secret. New backends = new enum value + Provider impl,
  no listener/SDS changes.
- The edge agent watches EdgeRoutes + their Secrets, resolves cert bytes, and
  serves them to Envoy over the agent's ADS SecretType channel (cache.SetSecrets,
  free since upstream certs come from SPIRE directly). Envoy selects the cert by
  SNI. Rotation is event-driven (Secret watch) with no pod roll.
- Listeners: TLS-terminating listener on httpsPort (one DownstreamTlsContext with
  N SDS certs, no client cert, min TLS 1.2, ALPN h2/http1.1) + a :80 listener that
  301-redirects to https. Plain HTTP when TLS off.
- Chart: edge.tls.enabled (+ edge.httpsPort, service.httpsPort); deployment passes
  --edge-tls/--edge-https-port, adds the :443 port + HTTPS readiness, NET_BIND_SERVICE
  covers 443; Service exposes https; edge Role gains secrets get/list/watch. Drops
  the mounted-Secret path. chart 0.11.0 -> 0.12.0.

Removed: the file-based EdgeTLS struct, edge-tls cert/key flags, mounted Secret.

Tests: kubernetesProvider + Registry (fake client); SDS downstream socket (ADS,
no client cert, TLS params); redirect listener (301 https); cache TLS-mode
two-listener set + SecretType cert; reconciler resolves provider/ref -> SDS name +
bytes (and tolerates an unresolvable ref).


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