Skip to content

feat(config): aether system config + proxy MeshConfig CRD (one chart) - #229

Merged
bpalermo merged 8 commits into
mainfrom
feat/mesh-config-configmap
Jun 19, 2026
Merged

bpalermo merged 8 commits into
mainfrom
feat/mesh-config-configmap

Conversation

@bpalermo

@bpalermo bpalermo commented Jun 18, 2026 •

Copy link
Copy Markdown
Owner

What & why

Mesh-wide behavior was configured by an ever-growing set of CLI flags, fanned out
by the charts into args: and mirrored in values.yaml — a four-place edit per
knob, and a helm upgrade re-stamped config every time.

This reorganizes configuration around two clear scopes and treats aether as one
system
:

  1. Aether system config — set ONCE, inherited by every component (agent,
    registrar, proxy, controller): OTEL (enable, OTLP endpoint, logs, trace
    sampling/export), SPIRE (enable), and the mesh domain. These are top-level
    values in the single aether chart, passed to each component as flags
    (deterministic, deploy-time).
  2. Proxy MeshConfig (CRD) — the proxy data plane may override only its own
    observability (access logs, tracing, metrics); unset fields inherit the
    system config. This is the only runtime-mutable, validated config object.

Full design: docs/proposals/015_mesh-config.md.

How it works

helm install crds    -> MeshConfig CRD (config.aether.io/v1, install ahead of time)
helm install aether  -> agent + Envoy proxy, registrar, controller (+ seeded MeshConfig CR)
kubectl edit meshconfig default
        -> /validate webhook (protovalidate) -> controller reconciler -> projects
                                                   <release>-mesh-config ConfigMap
   agent mounts the ConfigMap (proxy overrides); system config comes from flags

Key pieces

  • api/aether/config/v1 (proto only): MeshConfigSpec — a single proxy
    message of optional fields (access_logs_enabled,
    access_log_success_sample_rate, tracing_enabled, trace_sample_rate,
    emit_stats_pod); unset = inherit. API is config.aether.io/v1 from the start
    (proto field-number evolution gives compatibility).
  • common/apis/config/v1 (the only hand-written API Go): the typed
    MeshConfig CRD object (TypeMeta/ObjectMeta/Spec *MeshConfigSpec/Status)
    with a manual jsonshim (.spec (un)marshalled via protojson) and manual
    DeepCopy
    (proto spec cloned via proto.Clone) + a scheme. The controller
    works against this typed object — no unstructured.
  • common/config: one loader (YAML/JSON → protojson → protovalidate), reused
    at agent file-load, controller reconcile, and admission.
  • controller/cmd/controller (new aether-controller binary): leader-elected
    manager running the /validate webhook + the reconciler that projects the
    singleton CR into the ConfigMap. Seeds the default CR once (lookup +
    resource-policy: keep) so helm upgrade never re-stamps it.
  • Webhook serving cert: the SPIRE SVID when SPIRE is enabled (controller
    injects the trust bundle into the webhook caBundle, auto-rotating; leader-only
    writer), else a Helm self-signed cert. No cert-manager.

Charts

  • charts/crds: standalone CRD chart, installable ahead of time. spec is
    x-kubernetes-preserve-unknown-fields; the webhook is the authoritative
    validator.
  • charts/aether: one flat chart — agent DaemonSet + per-node Envoy proxy,
    registrar Deployment, and the controller. System config is top-level values; no
    umbrella/global indirection, no cross-chart name conventions. (Replaces the
    former separate agent/registrar/controller charts.)
  • Images: repository + digest (in-repo, digest-pinned) or repository +
    tag (external proxy), via an aether.image helper — override repository
    alone to mirror to a private registry.

Design decisions worth a look

  • Forward-compatible decode (lenient): all proto decode (jsonshim +
    config.Parse) uses DiscardUnknown — unknown fields are ignored, never an
    error. Strict decode would break rolling upgrades (an older controller/agent
    failing to decode a newer CR/ConfigMap). protovalidate still checks every
    known field; the tradeoff is a misspelled key is ignored rather than rejected.
  • No re-stamp on upgrade: the default CR is seeded once and never overwritten;
    operators own it via kubectl.
  • CNI determinism: CNI + the Envoy bootstrap take deterministic, deploy-time
    chart config — never a runtime ConfigMap — so a config change can't break CNI on
    freshly-rolled nodes while old nodes keep working. Only the proxy MeshConfig is
    runtime-mutable.
  • Webhook is HA, writes are single-writer: /validate is served by every
    controller replica (stateless validation; the Service load-balances across Ready
    pods). The reconciler and the caBundle injector are leader-only. In SPIRE
    mode each replica serves with its own SVID — all share one SPIFFE ID, so one
    registration entry (with the webhook Service DNS in dnsNames) covers them, and
    all SVIDs chain to the single injected caBundle.
  • Clean break, no fallback flags for the migrated knobs (proposal-005
    precedent).

Verification

  • bazel build //... ✅
  • bazel test //... — 45 tests pass (loader incl. forward-compat ignore + each
    protovalidate constraint; controller meshconfig incl. jsonshim round-trip and
    CR→ConfigMap→config.Parse round-trip; all chart lint/template tests; cmd
    tests).
  • Rendered the packaged aether chart: all components present with distinct
    release-derived names, one CRD + one webhook config + one seeded CR, images
    resolve to repository@digest, system config inherited by every component.
  • make format-check clean.

Not yet verified

Not exercised against a live cluster: the apiserver→webhook TLS handshake with a
SPIRE DNS-SAN'd SVID, the caBundle injection, and install ordering
(crds → aether; agent/registrar wait in ContainerCreating until the
controller projects the ConfigMap).

⚠️ Operational requirement (SPIRE mode): the controller's SPIRE
registration entry must list the webhook Service DNS name
<release>-controller-webhook.<ns>.svc in its dnsNames, or the apiserver's
TLS hostname check against the SVID fails. It applies to all replicas (shared
SPIFFE ID).

🤖 Generated with Claude Code

bpalermo and others added 7 commits June 18, 2026 18:23
Move mesh-wide policy (mesh domain, telemetry posture, SPIRE on/off) off the
growing set of CLI flags into a protobuf-backed MeshConfig, validated with
protovalidate. Per-instance/topology settings stay flags. See
docs/proposals/015_mesh-config.md.

- api/aether/config/v1: MeshConfig proto with buf/validate constraints
  (config.aether.io/v1; proto field-number evolution = backward compat).
- common/config: one loader — YAML/JSON -> protojson (strict) -> protovalidate
  -> defaults. Reused at file-load, controller self-config, and admission.
- aether-controller (new binary + charts/controller): validating webhook
  (protovalidate) + reconciler that projects the singleton MeshConfig CR into the
  ConfigMap the agent and registrar mount. Leader-elected; not folded into the
  registrar (keeps consumption uniform, webhook/LE off the registrar's budget).
- charts/crds: standalone CRD chart (install ahead of time; spec is
  x-kubernetes-preserve-unknown-fields, webhook is the authoritative validator).
- Default MeshConfig CR seeded ONCE (lookup + resource-policy: keep) so
  `helm upgrade` never re-stamps mesh config; operators own the CR via kubectl.
- Webhook serving cert uses the SPIRE SVID when spire.enabled (controller injects
  the trust bundle into caBundle, auto-rotating); else a Helm self-signed cert.
- agent/registrar: drop the migrated flags, mount the projected ConfigMap.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pihqn5RmVPhV9HTdBnqbvY
Keep the values leveling aligned across charts: every mesh-config value lives
under the `meshConfig` key.

- agent: move telemetry.otlpEndpoint -> meshConfig.telemetry.otlpEndpoint
  (Envoy/CNI plumbing); repoint configmap/proxy/daemonset references.
- controller: flatten meshConfig.default.{meshDomain,telemetry,security} up to
  meshConfig.* so the leveling matches the agent (meshConfig.telemetry…); the
  seeded CR spec is built from those keys, excluding configMapName/createDefault.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pihqn5RmVPhV9HTdBnqbvY
The agent and registrar charts no longer hold any MeshConfig-related values. They
derive the projected ConfigMap name from the release name via a chart helper
(<release>-mesh-config) and mount it — the controller projects into the same
release-derived name, so nothing needs to be kept in sync as a value.

- agent: drop the meshConfig block; otlpEndpoint moves back to telemetry
  (Envoy/CNI plumbing, not MeshConfig); add agent.meshConfigMapName helper.
- registrar: drop the meshConfig block; add registrar.meshConfigMapName helper.
- controller: drop meshConfig.configMapName (derive via controller.meshConfigMapName);
  keep only the CR-seed values (createDefault, meshDomain, telemetry, security).

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

Treat aether (registrar, agent, proxy, controller) as a single system. System
config (OTEL enable/endpoint/logs/trace, SPIRE enable, mesh domain) is set ONCE
and inherited by every component; the proxy data plane may override only its own
observability (access logs, tracing, metrics), defaulting to the system config.

- charts/aether: new umbrella chart bundling crds/controller/registrar/agent with
  a single `global` block (otel/spire/meshDomain) inherited by all subcharts.
- MeshConfig proto shrinks to a `proxy` message of optional override fields
  (access logs, tracing, metrics); unset = inherit. System telemetry/SPIRE/mesh
  domain leave MeshConfig and become aether flags fed by the globals.
- common/manager: restore otel/otlp/logs/trace flags (system config); drop
  ApplyTelemetry. Bootstrap takes optional ctrl.Options mutators.
- agent: applies proxy overrides on top of the inherited system config (trace
  rate inherits --trace-sample-rate); reads MeshConfig CM for proxy only.
- registrar/controller: telemetry + SPIRE from flags (globals); registrar no
  longer mounts MeshConfig (control plane, not proxy).
- controller: seeds default CR with spec.proxy only; its own telemetry from flags.
- common/config: loader is parse+validate only (inheritance is the agent's job).

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

The agent, registrar and controller always deploy together as one system, so they
collapse into a single flat `charts/aether` chart. This dissolves the umbrella +
`global` inheritance machinery: system config (OTEL, SPIRE, mesh domain) is just
top-level values referenced directly by each component — no subchart deps, no
cross-chart name conventions.

- charts/aether: one chart with agent DaemonSet + Envoy proxy, registrar
  Deployment, and the aether-controller (MeshConfig webhook + reconciler + seeded
  CR). Unified _helpers.tpl with component-scoped names (aether.{agent,proxy,
  registrar,controller}.*); per-component values under their name, system config
  at top level.
- Drop charts/agent, charts/registrar, charts/controller and the umbrella.
- charts/crds stays standalone (install ahead of time).

Images split into repository + digest (in-repo, digest-pinned) or repository +
tag (external proxy), via an aether.image helper, so consumers can mirror to a
private registry by overriding `repository` alone. CNI + Envoy bootstrap keep
deterministic deploy-time config (never a runtime ConfigMap).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pihqn5RmVPhV9HTdBnqbvY
Make MeshConfig an explicit, typed Kubernetes CRD object backed by a protobuf
spec, instead of reading the CR as unstructured.

- proto: rename message MeshConfig -> MeshConfigSpec (it is the CR's .spec).
- api/aether/config/v1: hand-written typed MeshConfig / MeshConfigList /
  MeshConfigStatus (TypeMeta/ObjectMeta/Spec *MeshConfigSpec/Status) with a manual
  jsonshim (.spec (un)marshalled via protojson, strict) and manual DeepCopy (proto
  Spec cloned via proto.Clone), plus a SchemeBuilder/AddToScheme.
- controller: webhook + reconciler use the typed object (no unstructured); the
  manager scheme = client-go + configv1. Webhook path is now just "/validate".
- common/config + agent: parse/apply MeshConfigSpec.
- chart: webhook clientConfig path -> /validate.

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

Keep //api proto-only (generated). The hand-written typed MeshConfig CRD object
(types + jsonshim + deepcopy + scheme) moves to a dedicated package
//common/apis/config/v1, importing the proto for its spec.

Also make all proto decoding LENIENT (DiscardUnknown) instead of strict — the
jsonshim (CR decode) and config.Parse (projected ConfigMap decode). Strict decode
broke forward-compatibility: an older controller/agent would fail to decode a CR
or ConfigMap that a newer version wrote with an unknown field, wedging it during a
rolling upgrade. Lenient decode is the protobuf compatibility contract; unknown
fields are ignored and protovalidate still checks every known field.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pihqn5RmVPhV9HTdBnqbvY
@bpalermo bpalermo changed the title feat(config): mesh-wide config via MeshConfig CRD + aether-controller feat(config): aether system config + proxy MeshConfig CRD (one chart) Jun 19, 2026
… SSA

Two fixes:

- agent: config.Load returns an empty MeshConfigSpec when the file is absent
  instead of erroring. Proxy overrides are optional (inherit everything), so a
  missing/unmounted ConfigMap must not crash the agent — this is what broke the
  e2e (hand-rolled agent DaemonSet with no /etc/aether mount) and also decouples
  startup from the controller having projected the ConfigMap yet.
- controller: use Server-Side Apply for all writes (field manager
  "aether-controller", force ownership) — the projected ConfigMap, the MeshConfig
  status condition, and the SPIRE caBundle injection. No read-modify-write; the
  caBundle apply targets existing webhook names so it owns only caBundle.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pihqn5RmVPhV9HTdBnqbvY
@bpalermo
bpalermo merged commit c82bdf0 into main Jun 19, 2026
14 checks passed
@bpalermo
bpalermo deleted the feat/mesh-config-configmap branch June 19, 2026 12:15
bpalermo added a commit that referenced this pull request Jun 19, 2026
The chart consolidation (#229) merged without updating the release workflows,
so the post-merge publish failed (`no such package charts/agent`) and the new
charts/images were never published.

- publish.yaml: push //charts/crds, //charts/aether (chart + agent/cni-install/
  registrar/controller images), //charts/prober — replacing the deleted
  agent/registrar push targets.
- proxy-release.yml: bump the proxy image in charts/aether/values.yaml, and as
  repository+tag (the proxy image is no longer a single `ref:`).

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
The chart consolidation (#229) merged without updating the release workflows,
so the post-merge publish failed (`no such package charts/agent`) and the new
charts/images were never published.

- publish.yaml: push //charts/crds, //charts/aether (chart + agent/cni-install/
  registrar/controller images), //charts/prober — replacing the deleted
  agent/registrar push targets.
- proxy-release.yml: bump the proxy image in charts/aether/values.yaml, and as
  repository+tag (the proxy image is no longer a single `ref:`).


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
* fix(ci): publish the consolidated aether + crds charts

The chart consolidation (#229) merged without updating the release workflows,
so the post-merge publish failed (`no such package charts/agent`) and the new
charts/images were never published.

- publish.yaml: push //charts/crds, //charts/aether (chart + agent/cni-install/
  registrar/controller images), //charts/prober — replacing the deleted
  agent/registrar push targets.
- proxy-release.yml: bump the proxy image in charts/aether/values.yaml, and as
  repository+tag (the proxy image is no longer a single `ref:`).

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

* feat(chart): decouple controller webhook cert from mesh SPIRE

The controller webhook serving cert was tied to spire.enabled (the mesh mTLS
toggle), which forced a SPIRE SVID webhook whenever the mesh used SPIRE — and that
needs a ClusterSPIFFEID granting the controller the webhook Service DNS SAN, or
the apiserver↔webhook TLS fails (fail-open).

Add controller.webhook.spire (default false): the webhook uses a Helm self-signed
cert (genSignedCert, caBundle baked in) that validates out of the box, independent
of mesh SPIRE. Set true to use the controller's SPIRE SVID (still requires the
ClusterSPIFFEID dnsNames). Mesh SPIRE (agent/registrar) is unchanged.

Bumps the aether chart to 0.5.0.

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