Skip to content

refactor(edge): retire VirtualHost CRD — Gateway API HTTPRoute is the only edge routing API - #292

Merged
bpalermo merged 1 commit into
mainfrom
refactor/retire-virtualhost-crd
Jun 24, 2026
Merged

bpalermo merged 1 commit into
mainfrom
refactor/retire-virtualhost-crd

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Summary

Proposal 018: make Gateway API the sole north-south edge routing surface and remove the VirtualHost CRD entirely. Both APIs previously coexisted (--gateway-api / edge.gatewayApi.enabled); this drops the selector and the legacy CRD.

What changed

  • Generalized the dup-FQDN webhook from a VirtualHost-specific check into a Gateway/HTTPRoute hostname-conflict check (controller/internal/gatewayapi): reject two HTTPRoutes claiming the same hostname on the same Gateway (shared parentRef); same FQDN on different Gateways is allowed, and *.suffix vs a specific host is not a conflict (Envoy resolves most-specific-first). Still served on the shared /validate endpoint, dispatched by Kind. The dup-FQDN test cases moved over.
  • Removed VirtualHost: the CRD (charts/crds/templates/virtualhost.yaml), Go types/deepcopy/jsonshim (common/apis/config/v1/virtualhost_*.go), the agent VirtualHost reconciler (agent/internal/edge/reconciler.go), the controller VirtualHost webhook (controller/internal/virtualhost/), and the --gateway-api/edge.gatewayApi.enabled selector. Gateway API is now unconditional in the edge.
  • Kept SecretProvider (still used for edge listener TLS resolution) by moving it into its own api/aether/config/v1/secret.proto; deleted virtual_host.proto.
  • Charts: edge RBAC reads gateways/httproutes only; the GatewayClass renders whenever edge.enabled; the validating webhook rule + controller ClusterRole target httproutes; flattened edge.gatewayApi.{enabled,gatewayClassName} → edge.gatewayClassName. Bumped charts/aether to 0.35.0 and charts/crds to 0.5.0.
  • E2E: replaced test/e2e/edge/virtualhost.yaml with httproute.yaml (a Gateway + HTTPRoute mirroring the old fixture: svc-5:3001 on /grpc, svc-2 exact /healthz, svc-1 catch-all /); refreshed the edge e2e README.

Feature parity (HTTPRoute vs VirtualHost)

The Gateway API path already covered everything VirtualHost did for the edge — per-FQDN ordered path routes to different backend services (rules/matches preserve order), wildcard-TLS certs (certForHosts matches *.suffix listeners), and multi-port backends. The only gap was duplicate-FQDN conflict detection, which lived solely in the VirtualHost webhook; this PR closes it on the HTTPRoute side (the generalized hostname-conflict webhook). No regression.

⚠️ BREAKING CHANGE — operator migration

The VirtualHost CRD (config.aether.io/v1) is removed. Migrate every VirtualHost CR to a Gateway API Gateway + HTTPRoute before upgrading:

For each VirtualHost:

  1. Ensure a Gateway of the edge GatewayClass (default aether) exists in the watched namespace.
  2. Create one HTTPRoute with:
    • spec.hostnames = the VirtualHost spec.hosts
    • spec.parentRefs → that Gateway
    • one rule per VirtualHost route: match.prefix → path.type: PathPrefix, match.exact → path.type: Exact; backend.service/backend.port → backendRef.name/backendRef.port
  3. Move spec.tls.secretName to the Gateway listener's tls.certificateRefs (a kubernetes.io/tls Secret).

Install the Gateway API CRDs (standard channel) out-of-band — aether no longer ships an edge routing CRD. See test/e2e/edge/httproute.yaml for a complete example.

Validation

bazel run //:gazelle, bazel build //..., bazel test //... (56/56 pass), bazel run //:format, and --config=lint all clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S

…only edge routing API

Proposal 018: make Gateway API the sole north-south edge routing surface and
remove the VirtualHost CRD entirely (BREAKING).

- Generalize the dup-FQDN validating webhook from VirtualHost-specific into a
  Gateway/HTTPRoute hostname-conflict check: reject two HTTPRoutes claiming the
  same hostname on the SAME Gateway (same parentRef). Still served on the shared
  /validate endpoint, dispatched by Kind. Moved the dup-FQDN tests over.
- Remove the VirtualHost CRD, Go types/deepcopy/jsonshim, the agent VirtualHost
  reconciler, the controller VirtualHost webhook, the chart template, and the
  e2e fixture. Drop the --gateway-api selector flag; Gateway API is unconditional.
- Keep the SecretProvider enum (still used for edge listener TLS) by moving it
  into its own secret.proto; delete virtual_host.proto.
- Charts: edge RBAC reads gateways/httproutes only; the GatewayClass always
  renders when edge.enabled; the validating webhook rule targets httproutes; the
  controller ClusterRole lists httproutes. Flatten edge.gatewayApi.{enabled,
  gatewayClassName} to edge.gatewayClassName. Bump aether 0.35.0, crds 0.5.0.
- Replace test/e2e/edge/virtualhost.yaml with httproute.yaml (Gateway+HTTPRoute);
  refresh the edge e2e README.

BREAKING CHANGE: the VirtualHost CRD (config.aether.io/v1) is removed. Operators
must migrate every VirtualHost CR to a Gateway API Gateway + HTTPRoute before
upgrading. Per VirtualHost: create one HTTPRoute with spec.hostnames = the
VirtualHost hosts, spec.parentRefs -> a Gateway of the edge GatewayClass
(default "aether"), and one rule per VirtualHost route (match.prefix ->
PathPrefix, match.exact -> Exact; backend.service/port -> backendRef.name/port).
Move spec.tls.secretName to the Gateway listener's tls.certificateRefs. Install
the Gateway API CRDs (standard channel) out-of-band; aether no longer ships an
edge routing CRD.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S
@bpalermo
bpalermo merged commit fbc508c into main Jun 24, 2026
11 checks passed
@bpalermo
bpalermo deleted the refactor/retire-virtualhost-crd branch June 24, 2026 11:31
bpalermo added a commit that referenced this pull request Jul 2, 2026
…ped (#460) (#463)

The 'in progress / not yet shipped' list was fully stale: the TCP-over-mTLS floor
(#295/#304), Phase 3b L4 routes (#296), VirtualHost retirement (#292), MCS phase 1,
and conformance (both profiles hard-gated) have all landed. Documents the tcp
protocol-declaration chain (endpoint.aether.io/protocol -> PROTOCOL_TCP ->
aether.io/app-protocol -> /32 floor chain) and the destination-IP-beats-ALPN
filter-chain-match gotcha.


Claude-Session: https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S

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