Skip to content

feat(controller): namespaced MeshConfig with aether-system fallback - #267

Merged
bpalermo merged 1 commit into
mainfrom
feat/namespaced-meshconfig
Jun 22, 2026
Merged

bpalermo merged 1 commit into
mainfrom
feat/namespaced-meshconfig

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

PR 1 of 2 for moving the edge into its own aether-ingress namespace. (PR 2 = the edge chart migration, depends on this.)

Why

The edge will live in aether-ingress and mount a <release>-mesh-config ConfigMap — but mounts are namespace-local, and the controller projected the singleton MeshConfig only into the control-plane namespace. Rather than a configured target-namespace list (and two flags), make MeshConfig namespaced and have the controller co-locate the projected ConfigMap with the CR — so there's no namespace setting at all.

What

  • CRD scope: Cluster → Namespaced — one default MeshConfig per namespace.
  • Reconciler co-locates: projects into ConfigMap{Name, Namespace: req.Namespace}. The ConfigMapNamespace field + --mesh-config-namespace flag are removed.
  • aether-system fallback: a namespace's effective config = the control-plane (controller's own) namespace MeshConfig, with that namespace's CR merged over it (set fields win; edition-2024 field presence respected). A namespace inherits the mesh-wide config unless it overrides; the fallback namespace projects verbatim.
  • Fan-out: a change to the fallback MeshConfig re-projects every inheriting namespace (Watches + a map func over MeshConfigList).
  • RBAC: ConfigMap write is now cluster-wide (a MeshConfig can be in any namespace) — a ClusterRole + ClusterRoleBinding; leases/events stay a namespaced Role.
  • Seed CR is namespaced (release ns); the lookup is namespace-scoped.

Tests

effectiveSpec (verbatim in the fallback ns; merge-over-fallback for an override; own-spec when no fallback) and enqueueInheritors (fan-out only on a fallback-ns change). bazel build //... + //controller/... tests green.

⚠️ BREAKING — CRD scope migration

A CRD's scope can't change in place. Upgrading requires deleting the old cluster-scoped CRD first:

kubectl delete crd meshconfigs.config.aether.io   # removes the cluster-scoped 'default' CR

then applying the namespaced CRD; the chart re-seeds a namespaced default in the release namespace. Operators with hand-edited mesh config re-apply it after.

MeshConfig was a cluster-scoped singleton projected into one ConfigMap in the
control-plane namespace. To let an isolated component (the edge, moving to
aether-ingress) mount a co-located ConfigMap — without a configured namespace
list — make MeshConfig namespaced and have the controller project each CR into a
ConfigMap in its OWN namespace.

- CRD scope Cluster -> Namespaced (one `default` MeshConfig per namespace).
- Reconciler co-locates: projects into ConfigMap{Name, Namespace: req.Namespace}.
  The ConfigMapNamespace field/flag is gone — the namespace is the CR's.
- aether-system fallback: a namespace's effective config is the control-plane
  (controller's own) namespace MeshConfig with that namespace's CR merged over it
  (set fields win, edition-2024 presence respected). A namespace inherits the
  mesh-wide config unless it overrides; the fallback namespace projects verbatim.
- Fan-out: a change to the fallback MeshConfig re-projects every inheriting
  namespace (Watches + map func over MeshConfigList).
- RBAC: ConfigMap write is now cluster-wide (a MeshConfig can be in any ns) — a
  ClusterRole + ClusterRoleBinding; leases/events stay a namespaced Role.
- Seed CR is namespaced (release ns); the lookup is namespace-scoped.

Tests: effectiveSpec (verbatim in the fallback ns, merge-over-fallback for an
override, own-spec when no fallback) + enqueueInheritors (fan-out only on a
fallback-ns change).

BREAKING: a CRD scope change is not allowed in place. Upgrading requires deleting
the old cluster-scoped CRD (`kubectl delete crd meshconfigs.config.aether.io`,
which removes the cluster-scoped `default` CR) before applying the namespaced CRD;
the chart re-seeds a namespaced `default` in the release namespace. Operators with
hand-edited config re-apply it.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S
@bpalermo
bpalermo force-pushed the feat/namespaced-meshconfig branch from d28c5a7 to 8f6c77c Compare June 22, 2026 21:21
@bpalermo
bpalermo merged commit 7976b43 into main Jun 22, 2026
14 checks passed
@bpalermo
bpalermo deleted the feat/namespaced-meshconfig branch June 22, 2026 21:24
bpalermo added a commit that referenced this pull request Jun 22, 2026
* feat(edge): run the edge in its own aether-ingress namespace

The edge is an ingress gateway, not a mesh workload. Move its resources out of the
release namespace into a dedicated `aether-ingress` (configurable via
edge.namespace; the chart creates it with baseline PSA unless namespaceCreate is
false). #266's explicit aether.io/managed=false label keeps it mesh-excluded
namespace-agnostically (the CNI plugin no longer skips it by namespace, but the
agent's isIgnorablePod still ignores it by label). Edge stays opt-in
(edge.enabled default false).

- New aether.edge.namespace helper; edge Deployment/Service/ServiceAccount/
  ConfigMap/Role+RoleBinding/ClusterSPIFFEID-selector all render into it.
- edge-namespace.yaml creates aether-ingress (baseline PSA — the edge is
  unprivileged, unlike the agent/CNI's privileged control-plane namespace).
- edge-meshconfig.yaml seeds a namespaced `default` MeshConfig in aether-ingress
  with an empty spec: it inherits the control-plane MeshConfig via the controller's
  fallback (PR #267), so the edge's projected ConfigMap mirrors the mesh by
  default; operators can edit it for edge-specific observability.
- SPIRE: the ClusterSPIFFEID namespaceSelector targets aether-ingress; the
  PodMeta.Namespace template makes the SVID ns/aether-ingress/sa/aether-edge.
- Pass --registrar-address explicitly (release-namespace-correct) since the edge
  now reaches the registrar cross-namespace and the binary default assumes
  aether-system.

Depends on #267 (namespaced MeshConfig). Chart 0.20.0 -> 0.21.0.

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

* docs(edge): correct the managed-label + toleration rationale for the namespace move

The edge no longer runs in aether-system, so "the CNI plugin skips aether-system
pods" is stale: in its own namespace the plugin calls the agent, which ignores the
edge via the managed=false label. Update both comments.

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