Repository navigation
feat(edge): EdgeRoute CRD + live watch driving the edge route table - #237
Merged
Merged
Conversation
Replace the edge proxy's static --expose seed as the sole exposure mechanism with an EdgeRoute custom resource (config.aether.io/v1, namespaced): external host -> mesh service[:port] mappings the edge agent watches and projects into its xDS route table live, with no redeploy. - api/aether/config/v1: EdgeRouteSpec proto (hosts/service/port, protovalidate), edition 2024 opaque API alongside MeshConfigSpec. - common/apis/config/v1: hand-written typed EdgeRoute CRD (types + protojson jsonshim + deepcopy), registered on the shared config.aether.io scheme; lenient decode for rolling-upgrade forward-compat — same machinery as MeshConfig. - charts/crds: namespaced EdgeRoute CRD (permissive structural schema; authoritative validation is protovalidate). Chart version 0.1.0 -> 0.2.0. - snapshot cache: cache.EdgeRoute + SetEdgeRoutes scopes the dependency set to the referenced services and rebuilds the edge route table from the routes (even when only hostnames change). Host->cluster resolution picks the default vs per-port cluster; routes to the same cluster merge into one vhost (Envoy NACKs duplicate vhost names/domains). - agent: an EdgeRoute reconciler (level-based: re-lists each reconcile) merges the CRs with the --expose static seed and pushes the full set into the cache. runEdge builds the manager scheme, scopes its informer cache to the watched namespace (namespaced RBAC), seeds routes up front, and registers the reconciler. Tests: EdgeRoute JSON round-trip + lenient decode + deepcopy; cache SetEdgeRoutes dependency set + host/port cluster resolution + vhost merge; reconciler projection (namespace filtering, seed merge, inert-route skip) via the controller-runtime fake client. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Pihqn5RmVPhV9HTdBnqbvY
This was referenced Jun 19, 2026
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.
What
PR2 of the edge proxy plan (stacked on #236). Adds the
EdgeRoutecustom resource (config.aether.io/v1, namespaced) — external host → mesh service[:port] mappings the edge agent watches and projects into its xDS route table live, no redeploy — replacing the--exposeflag as the primary exposure mechanism (it stays as a static seed).Why a custom CRD (vs Gateway API)
Per the approved plan: a tiny CRD names the mesh service directly (
service= ServiceAccount = registry key, no Service-object indirection) and reuses the controller-runtime + CRD machinery from #229. The edge agent is already a manager, so watching a small CR is far less code than even a subset of Gateway API conformance. The spec is shaped to migrate to Gateway API later if the full L7 vocabulary is wanted.Highlights
EdgeRouteSpec(hosts/service/port, protovalidate) inapi/aether/config/v1— edition 2024 opaque API, alongsideMeshConfigSpec.common/apis/config/v1— hand-written types + protojson jsonshim + deepcopy, registered on the sharedconfig.aether.ioscheme; lenient decode for rolling-upgrade forward-compat (same machinery as MeshConfig).EdgeRouteCRD incharts/crds(permissive structural schema; authoritative validation is protovalidate). Chart0.1.0 → 0.2.0.cache.EdgeRoute+SetEdgeRoutes: scopes the dependency set to the referenced services and rebuilds the route table from the routes (even when only hostnames change). Host→cluster resolution picks default vs per-port cluster; routes to the same cluster merge into one vhost (Envoy NACKs duplicate vhost names/domains).EdgeRoutereconciler (re-lists each reconcile) merges CRs with the--exposeseed and pushes the full set into the cache.runEdgebuilds the manager scheme, scopes its informer cache to the watched namespace (namespaced RBAC), seeds routes up front, and registers the reconciler.Example
Tests
EdgeRoute JSON round-trip + lenient decode + deepcopy; cache
SetEdgeRoutesdependency set + host/port cluster resolution + vhost merge; reconciler projection (namespace filtering, seed merge, inert-route skip) via the controller-runtime fake client.bazel build //...,bazel test //agent/... //common/... //api/... //controller/... //registry/...(31/31),--config=lint,make format, andscripts/check-chart-version-bump.shall pass. Both CRDs render viahelm template.Follow-ups
edge.enabledincharts/aether; bootstrap defining thespire_agentSDS cluster; RBAC for the EdgeRoute watch).🤖 Generated with Claude Code