Repository navigation
build(mesh-dns): give the daemon its own slim image (#583 option B) - #594
Merged
Merged
Conversation
…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
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.
Follows #583 — this is its deferred option B.
Why
#583 built the slim standalone
/mesh-dnsbinary (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 runningcommand: ["/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
:53DNAT.What
//agent/cmd/mesh-dns:mesh-dns_imagevia the samego_multi_arch_imagemacro as every other image: distrolessnonroot, amd64+arm64image_index,image_load/image_push/image_test. Entrypoint/mesh-dns, repositorybpalermo/aether/mesh-dns.tars_layerdropped). Nothing else referenced/mesh-dns— theagent mesh-dnscobra subcommand was already retired in mesh-dns: build a dedicated slim binary for the daemon instead of reusing the full /agent #583.//charts/aether:aether.pushpublishes the chart together with the images in itsimagesattr, so adding//agent/cmd/mesh-dns:image_pushthere is the entire wiring. It also digest-pins the newagent.meshDnsDaemon.imageplaceholders at package time. Verified:bazel query 'deps(//charts/aether:aether.push, 2)'now lists//agent/cmd/mesh-dns:image_push.agent.meshDnsDaemon.image(repository+digest+tag+pullPolicy), stamped exactly likeagent.image, rendered through theaether.imagehelper.command: ["/mesh-dns"]and the exec readiness probe are unchanged. Chart0.87.0→0.88.0./mesh-dnsand not/agent; the agent image now asserts/mesh-dnsis absent, so it can't silently re-acquire the payload.make load-all/push-all, the threee2e/multicluster_*.shscripts, 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 otherwiseImagePullBackOffin kind.Size
Single-manifest docker tarball (zstd layers), the pushed/pulled artifact:
Underlying binaries:
agent67.1 MB vsmesh-dns16.9 MB.Slim dep graph re-proved
Verification
bazel build //...— 283 targets, greenbazel test --test_tag_filters=-integration //...— 74/74 pass (incl. bothimage_tests,aether_lint_test,aether_template_test)bazel build --config=ci //...— cleanbazel run //:format+make format-check— cleanmake gazelle— no drift (it addeddata = glob(["testdata/**"])tomesh-dns_testfor the new testdata dir; kept as generated)--stampand confirmedagent.meshDnsDaemon.imageresolves toghcr.io/bpalermo/aether/mesh-dns@sha256:…--help,--readiness-check) incl. as uid 65532; confirmed/mesh-dnsis gone from the agent image🤖 Generated with Claude Code
https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR