Skip to content

build(mesh-dns): give the daemon its own slim image (#583 option B) - #594

Merged
bpalermo merged 2 commits into
mainfrom
feat/mesh-dns-image
Jul 26, 2026
Merged

bpalermo merged 2 commits into
mainfrom
feat/mesh-dns-image

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Follows #583 — this is its deferred option B.

Why

#583 built the slim standalone /mesh-dns binary (no controller-runtime, no xDS/go-control-plane, no CNI server, no SPIRE) and cut the daemon from ~51m→16m CPU and ~14→5Mi RSS. But to avoid standing up a new publish pipeline at the time, that binary shipped as an extra layer inside the agent image, with the DaemonSet running command: ["/mesh-dns"] out of .Values.agent.image.

So today every node pulls controller-runtime, xDS, the CNI server and SPIRE for a process that executes none of it — wasted pull bandwidth, and unnecessary attack surface for a component that binds a host port and is reached by every managed pod's :53 DNAT.

What

  • New image //agent/cmd/mesh-dns:mesh-dns_image via the same go_multi_arch_image macro as every other image: distroless nonroot, amd64+arm64 image_index, image_load / image_push / image_test. Entrypoint /mesh-dns, repository bpalermo/aether/mesh-dns.
  • Agent image loses the interim layer (tars_layer dropped). Nothing else referenced /mesh-dns — the agent mesh-dns cobra subcommand was already retired in mesh-dns: build a dedicated slim binary for the daemon instead of reusing the full /agent #583.
  • Publish wiring: no new step. //charts/aether:aether.push publishes the chart together with the images in its images attr, so adding //agent/cmd/mesh-dns:image_push there is the entire wiring. It also digest-pins the new agent.meshDnsDaemon.image placeholders at package time. Verified: bazel query 'deps(//charts/aether:aether.push, 2)' now lists //agent/cmd/mesh-dns:image_push.
  • Chart: new agent.meshDnsDaemon.image (repository + digest + tag + pullPolicy), stamped exactly like agent.image, rendered through the aether.image helper. command: ["/mesh-dns"] and the exec readiness probe are unchanged. Chart 0.87.0 → 0.88.0.
  • Container tests assert the split in both directions: the new image has /mesh-dns and not /agent; the agent image now asserts /mesh-dns is absent, so it can't silently re-acquire the payload.
  • Harnesses: make load-all / push-all, the three e2e/multicluster_*.sh scripts, and the e2e/conformance workflow jobs build, load and --set agent.meshDnsDaemon.image.* the new image — the daemon no longer inherits the agent's local kind override, so it would otherwise ImagePullBackOff in kind.

Size

Single-manifest docker tarball (zstd layers), the pushed/pulled artifact:

image before after
agent 26.8 MiB 20.4 MiB (−23.8%)
mesh-dns DaemonSet pull 26.8 MiB (the agent image) 7.2 MiB (−73.2%)

Underlying binaries: agent 67.1 MB vs mesh-dns 16.9 MB.

Slim dep graph re-proved

$ bazel query 'somepath(//agent/cmd/mesh-dns:mesh-dns, @io_k8s_sigs_controller_runtime//...)'
INFO: Empty results

$ bazel query 'somepath(//agent/cmd/mesh-dns:mesh-dns, @com_github_envoyproxy_go_control_plane//...)'
INFO: Empty results

Verification

  • bazel build //... — 283 targets, green
  • bazel test --test_tag_filters=-integration //... — 74/74 pass (incl. both image_tests, aether_lint_test, aether_template_test)
  • bazel build --config=ci //... — clean
  • bazel run //:format + make format-check — clean
  • make gazelle — no drift (it added data = glob(["testdata/**"]) to mesh-dns_test for the new testdata dir; kept as generated)
  • Packaged the chart with --stamp and confirmed agent.meshDnsDaemon.image resolves to ghcr.io/bpalermo/aether/mesh-dns@sha256:…
  • Loaded the image and ran both entrypoint paths (--help, --readiness-check) incl. as uid 65532; confirmed /mesh-dns is gone from the agent image

🤖 Generated with Claude Code

https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR

bpalermo and others added 2 commits July 26, 2026 09:17
…art 0.88.0)

#583 built a slim standalone `/mesh-dns` binary (no controller-runtime, no
xDS/go-control-plane, no CNI server, no SPIRE) and cut the daemon to ~16m CPU /
~5Mi RSS, but to avoid standing up a second publish pipeline it shipped as an
extra LAYER inside the agent image, with the DaemonSet running `/mesh-dns` from
`agent.image`.

That left every node pulling the whole agent for a process that executes none of
it — wasted bandwidth, and needless attack surface for a component that binds a
host port and answers every managed pod's :53 DNAT. This is the deferred option B.

- `//agent/cmd/mesh-dns:mesh-dns_image`: same `go_multi_arch_image` macro as every
  other image (distroless nonroot, amd64+arm64 index, `image_load`/`image_push`),
  entrypoint `/mesh-dns`, repository `bpalermo/aether/mesh-dns`.
- Drop the interim `tars_layer` from the agent image. Nothing else referenced the
  path (the `agent mesh-dns` cobra subcommand was retired in #583).
- Publishing needs no new step: `//charts/aether:aether.push` publishes the images
  in the chart's `images` attr, so adding `//agent/cmd/mesh-dns:image_push` there
  is the whole wiring, and it also digest-pins the new
  `agent.meshDnsDaemon.image` placeholders at package time.
- Container tests now assert the split in both directions: the new image has
  `/mesh-dns` and NOT `/agent`; the agent image asserts `/mesh-dns` is absent, so
  it can't silently re-acquire the payload.
- kind/e2e harnesses (multicluster config/replicator/waypoint + the conformance
  jobs) build, load and `--set agent.meshDnsDaemon.image.*` the new image, since
  the daemon no longer inherits the agent's local override.

Size (single-manifest zstd tarball): agent 26.8Mi -> 20.4Mi; the mesh-dns
DaemonSet's pull drops 26.8Mi -> 7.2Mi (-73%).

Follows #583.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR
Follows the mesh-dns image split: `make build-mesh-dns` / `load-mesh-dns-image`
join the list, and `load-all` / `push-all` now cover it.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR
@bpalermo
bpalermo merged commit 0334705 into main Jul 26, 2026
15 checks passed
@bpalermo
bpalermo deleted the feat/mesh-dns-image branch July 26, 2026 12:33
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