Skip to content

feat(mesh-dns): slim standalone binary for the daemon (#583) - #584

Merged
bpalermo merged 1 commit into
mainfrom
feat/mesh-dns-slim-binary
Jul 24, 2026
Merged

bpalermo merged 1 commit into
mainfrom
feat/mesh-dns-slim-binary

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Slim standalone /mesh-dns binary for the aether-mesh-dns daemon, so it no longer ships + re-execs the full /agent binary (controller-runtime, xDS, CNI…).

What

  • New agent/cmd/mesh-dns/main.go — self-contained resolver entrypoint (snapshot load + fsnotify reload + REUSEPORT serve + --readiness-check), importing only agent/internal/meshdns and light deps.
  • common/file: swapped a leftover ctrl.Log → slog (the sole leak dragging controller-runtime into the slim graph; aligns with the refactor(logging): migrate from logr/zap to stdlib slog for native trace correlation #223 slog migration).
  • /mesh-dns added to the agent image (one image, both binaries) — no new image/publish pipeline this pass.
  • Chart: command: ["/mesh-dns"], probe periodSeconds 5→15 / timeoutSeconds 5→2, resources dropped (req 25m/32Mi, lim 100m/64Mi), Chart 0.85.0→0.86.0.
  • Retired the now-duplicate agent mesh-dns subcommand.

Slim dep-graph proof

bazel query 'somepath(//agent/cmd/mesh-dns:mesh-dns, @io_k8s_sigs_controller_runtime//...)' and the go-control-plane equivalent both return empty.

Why

Reclaims the ~250m fleet CPU the daemon spent re-execing the full /agent for its readiness marker every 5s — via a cheap slim-binary re-exec, keeping the provably-pod-local marker (NOT httpGet, which is unsafe on host-network+surge). Resolver semantics + surge/readiness guarantee unchanged.

Closes #583. Resolves #582 (httpGet abandoned as unsafe on host-network+surge; CPU reclaimed here instead).

🤖 Generated with Claude Code

The aether-mesh-dns DaemonSet ran `command: ["/agent"] args: ["mesh-dns", …]`,
shipping and re-execing the ENTIRE agent binary (controller-runtime, xDS/
go-control-plane, CNI, SPIRE) just to serve a snapshot-fed DNS resolver — and
its readiness probe re-execed that huge binary every 5s.

Add a dedicated slim `//agent/cmd/mesh-dns` binary that imports ONLY the
`meshdns` resolver, snapshot fsnotify reload, resolv.conf upstream defaulting,
and push-only OTel telemetry. Verified via `bazel query somepath` that it pulls
in neither controller-runtime nor go-control-plane. To unblock that graph,
`common/file` now logs via stdlib slog instead of `ctrl.Log`, dropping its
controller-runtime edge (it's a low-level file util used everywhere).

The slim binary ships in the same agent image as an extra `/mesh-dns` layer
(no new image/publish pipeline this pass; #583's separate-image option is
deferred). The `agent mesh-dns` subcommand is retired — one code path now.

Chart: DaemonSet runs `/mesh-dns`; the readiness probe re-execs the slim
`/mesh-dns --readiness-check` (cheap) instead of the full agent, so period
15s / timeout 2s and resources drop to req 25m/32Mi lim 100m/64Mi.

Resolves #582: its proposed in-process httpGet probe is UNSAFE on a
host-network + maxSurge DaemonSet (two pods share the host netns → a health
port collides without SO_REUSEPORT or is REUSEPORT-ambiguous = the false-ready
#580 rejected). We keep the provably-pod-local ready-marker exec probe and
reclaim the ~250m fleet CPU by making the re-exec cheap via the slim binary.

Resolver semantics (EDNS0 echo, NODATA-for-non-A, authoritative never-forward,
REUSEPORT, marker-after-bind) and the surge/readiness guarantee are unchanged.

Closes #583

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR
@bpalermo
bpalermo merged commit 8e1f2e2 into main Jul 24, 2026
14 checks passed
@bpalermo
bpalermo deleted the feat/mesh-dns-slim-binary branch July 24, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant