Repository navigation
feat(uds-csi): the csi.aether.io node plugin, its image and chart wiring (proposal 039 Phase 1) - #1090
Merged
Conversation
…ing (proposal 039 Phase 1) A stateless CSI node plugin (Identity + Node, ephemeral inline volumes only) that gives a UDS-served pod a mesh-owned socket directory: on NodePublishVolume it mounts a fresh tmpfs at /run/aether/uds/<pod-uid> (nosuid,nodev,noexec,nosymfollow, mode=2770,uid=0,gid=<fsGroup>, size cap) and binds it onto the kubelet's target path. A pod without an fsGroup is refused with InvalidArgument (FailedMount naming the fix). The per-pod directory is derived from the kubelet-supplied pod UID only; unpublish recovers it from target_path, so the plugin keeps no state. The plugin serves the kubelet's plugin-registration API itself (a copy of k8s.io/kubelet's pluginregistration/v1 api.proto, edition 2023, package kept as `pluginregistration`), so there is no node-driver-registrar sidecar. A kubelet-reported registration error exits the process non-zero. MS_NOSYMFOLLOW is passed to mount(2) rather than applied with a later mount_setattr(2): the plugin mounts in its own mount namespace and the host copy made by Bidirectional propagation keeps the flags the mount had when it propagated. Seen on kind: with mount_setattr the host mount lacked nosymfollow and followed a symlink the app planted. - agent/cmd/uds-csi + agent/internal/udscsi (Mounter interface; unit tests against a fake need no root; registration tested over a real UDS) - //agent/cmd/uds-csi:deps_test + scripts/check-uds-csi-deps.sh (CI): no client-go, controller-runtime, apimachinery, SPIRE or go-control-plane - image quay.io/aethermesh/uds-csi, added to every image enumeration (chart images, registry-lib, build IDs, Makefile, e2e); publish-verify now reads the image component list as of each commit, so heads that predate uds-csi are not reported MISSING - charts/aether: udsCsi values (default OFF), uds-csi-daemonset.yaml, uds-csi-csidriver.yaml (fsGroupPolicy File, podInfoOnMount), chart 1.0.16, helm template tests incl. a new helm_template_absent_test rule - e2e/uds-csi.sh + nightly uds-csi job: CSINode registration, publish, host-side nosymfollow, unpublish, fsGroup refusal, plugin roll Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
force-pushed
the
feat/039-uds-csi-phase1
branch
from
September 30, 2026 21:49
c85e20c to
3c9bf67
Compare
Resolve docs/proposals/039_uds-csi-driver.md against #1084's decisions: keep main's decision text verbatim, add the Phase 1 implementation line under it, and cut "Phase 1 as built" down to the departures from the design (MS_NOSYMFOLLOW at mount time, registration-error exit path, validation details, value names, gate). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
Resolve docs/configuration.md against #1081's docs refresh: keep main's new `identity-ready` CLI section verbatim and follow it with the `uds-csi` section (the two were inserted at the same point). CLAUDE.md and docs/runbook.md merged cleanly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
This was referenced Sep 30, 2026
docs: proposal 039 still reads Draft and Phase-0-gated; mark it implemented and record Phase 3
#1110
Closed
bpalermo
added a commit
that referenced
this pull request
Oct 1, 2026
#1111) Proposal 039 designs the per-pod tmpfs with size=<small>,nr_inodes=<small>; Phase 1 as built (#1090) passed only mode/uid/gid/size, so the inode cap was the kernel default (half the node's RAM pages), and a workload could fill its socket directory with empty files far past anything `size` bounds. - uds-csi: new --inodes flag (default 64, at least 8, validated in NewDriver); the mount data string is now exactly mode=2770,uid=0,gid=<fsGroup>,size=<bytes>,nr_inodes=<n>. - chart: udsCsi.inodes (default 64) renders --inodes as a plain integer and fails the install below 8. Chart 2.1.0. - e2e/uds-csi.sh: the host mount carries nr_inodes=64 (findmnt) and df reports 64 inodes; filling /s fails with ENOSPC at file 62 (root dir, socket and the symlink leg hold the other three), 0 inodes free, and the socket still answers. - docs: configuration.md (value + flag) and the proposal's Phase 1 as built. Closes #1107 Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr Co-authored-by: Claude Fable 5.1 <[email protected]>
bpalermo
added a commit
that referenced
this pull request
Oct 1, 2026
) (#1117) Status Implemented: Phase 1 (#1090) and Phase 2 (#1092, chart 2.0.0) shipped; Phase 3 complete except the node reboot (#1106). Phase 0a (#1083) was not run and is recorded as superseded; the confused-deputy finding stays as the motivation, with what now prevents it. Adds a Phase 3 as-built section (deploy, first 8 h soak, plugin roll under load), the #1111 inode cap and #1112 soak harness follow-ups, the second-volume_id rejection superseded by the admission webhook, and 034 Phase 2 as unblocked but deferred (also in 034's supersession note). Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr Co-authored-by: Claude Fable 5.1 <[email protected]>
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.
Note
The
quay.io/aethermesh/uds-csirepository (public, release robot write) was created 2026-09-30, so//charts/aether:aether.push_imagescan publish the new image on merge.What
Proposal 039 Phase 1: the
csi.aether.ioCSI node plugin, itsuds-csiimage and itscharts/aetherwiring. It ships off (udsCsi.enabled: false) and nothing consumes it yet. Phase 2, the breaking cut-over that makes it the only UDS carrier, is a later PR.Design
Node plugin (
agent/cmd/uds-csi, logic inagent/internal/udscsi). It is stateless and serves CSI Identity (GetPluginInfo,GetPluginCapabilities= none,Probe) and Node (NodeGetInfo,NodeGetCapabilities=VOLUME_MOUNT_GROUP,NodePublishVolume,NodeUnpublishVolume). It takes ephemeral inline volumes only and has no Controller service.<root>/<pod-uid>(default/run/aether/uds) withMS_NOSUID|MS_NODEV|MS_NOEXEC|MS_NOSYMFOLLOWand datamode=2770,uid=0,gid=<volume_mount_group>,size=<bytes>, then bind it ontotarget_path. The plugin createstarget_pathif needed. The call is idempotent: if the target is already our tmpfs bind, it returns OK.InvalidArgument, which the pod shows asFailedMount):volume_mount_group, i.e. the pod has no fsGroup. The message names the fix:set pod.spec.securityContext.fsGroup.ephemeral=truevolumeAttributesreadonlytarget_pathoutside<kubelet-root>/pods/<that-uid>/MNT_DETACH) and rmdir it. Each step tolerates "already done". The pod UID comes fromtarget_path, so the plugin keeps no state. The per-pod directory is derived from the kubelet-supplied pod UID only: never from the volume id, the volume name, or any other context value./proc/self/mountinfo) goes through it, usingx/sys/unixdirectly (distroless has nomount). Unit tests use a fake and need no root.node-driver-registrar:api/aether/kubelet/pluginregistration/v1/api.protois copied fromk8s.io/kubeletand converted to edition 2023 with implicit presence, so the wire format is identical. The proto package stayspluginregistration, because the kubelet dials/pluginregistration.Registration/*.bazel/lint/buf.yamlscopes the naming-ruleignore_onlyto that one file.Registrationon<kubelet-root>/plugins_registry/csi.aether.io-reg.sockand CSI on<kubelet-root>/plugins/csi.aether.io/csi.sock.GetInforeturnsCSIPlugin/csi.aether.io/ the CSI socket path /["1.0.0"].NotifyRegistrationStatuswith an error logs it and endsServewith that error, so the process exits 1.--kubelet-root,--csi-socket,--registration-socket(both derived from the kubelet root),--node-id(defaults to$NODE_NAME),--root,--size,--debug, and--probe(the exec liveness probe: exit 0 iff the CSI socket exists). Flags are parsed with stdlibflag.//agent/cmd/uds-csi:deps_testchecks the linked ELF andscripts/check-uds-csi-deps.shchecks the build graph. Both forbid controller-runtime, client-go, apimachinery, k8s.io/api, gateway-api, go-control-plane, go-spiffe, miekg/dns, cobra and the OTel SDK. The script is wired intoci.yamlandmain.yamlnext to the proxy-supervisor guard. SPIRE is not involved anywhere; the e2e runs withspire.enabled=false.Why
MS_NOSYMFOLLOWis amount(2)flag and notmount_setattr. The first kind run usedmount_setattr(MOUNT_ATTR_NOSYMFOLLOW)after the mount. The host's copy of the per-pod tmpfs came outrw,nosuid,nodev,noexec,relatimewithoutnosymfollow, and root on the host followed a symlink the app had planted (cat /run/aether/uds/<uid>/linkprinted the node's hostname).The cause: the plugin mounts in its own mount namespace, and the copy that Bidirectional propagation creates on the host keeps the flags the mount had when it propagated. A later
mount_setattronly changes the plugin's own copy. The host copy is what the node proxy's HostToContainer/run/aetherview clones.So the flag now goes into
mount(2)itself. On a kernel older than 5.10 that returnsEINVAL, the plugin retries without it and logs a warning. The same run showed that the app's view does not carry per-mount flags: the container runtime re-bindstarget_pathwith flags it chooses, and the pod sees plainrw. Only the superblock options (size, mode, gid) reach the pod. That is enough, because the confused deputy is the proxy, so the e2e asserts the per-mount flags on the host.Image:
quay.io/aethermesh/uds-csi(proposal 040 naming). It is added to every place images are listed:AETHER_IMAGES, soaether.push_imagespublishes it and signs it through the shared listREGISTRY_IMAGE_COMPONENTSinscripts/registry-lib.shbazel/img_COMPONENTS//tools/buildid:release_build_idsMakefile(build-/load-/push-uds-csi-image,load-all,push-all)IMAGES=lists and helmimgoverrides. These are inert while the plugin is off, and they pre-wire Phase 2's default flip.The image uses the same distroless base as every aether image. The chart runs the container
privilegedwithrunAsUser: 0, the way it runs the agent, proxy and mesh-dns containers on that base.publish-verify: with the ninth image, the sweep would have reported
uds-csiMISSING for every push head in the day before this merge. The verifier now readsREGISTRY_IMAGE_COMPONENTSas of each commit (registry_image_components_at, inregistry-lib.sh), the same way it already readsregistry.bzland chart versions per commit. The expected-red control counts per base the same way. Harness counts are 20 → 22 lines and 12 → 13 witnesses.check-publish-verify-control.shpasses 20/20,check-registry-lookup.sh43/43,check-registry-config.shOK andcheck-proxy-pin.sh27/27.Chart (
charts/aether,1.0.15→1.0.16):uds-csi-daemonset.yaml:readOnlyRootFilesystem,drop: [ALL]Bidirectionalon<kubeletRoot>/podsand onudsCsi.rootpods,plugins/csi.aether.ioandplugins_registrysystem-node-critical,maxSurge: 0/maxUnavailable: 1aether.io/agent-not-readytoleration plusudsCsi.tolerationsautomountServiceAccountToken: false(no RBAC)/uds-csi --probeuds-csi-csidriver.yaml:attachRequired: false,podInfoOnMount: true,volumeLifecycleModes: [Ephemeral],fsGroupPolicy: File,requiresRepublish: false,seLinuxMount: false.udsCsi.{enabled (false), image, kubeletRoot (/var/lib/kubelet; Talos uses the default), root, size (1Mi), debug, nodeSelector, tolerations, resources}. The chart fails a non-absolutekubeletRootorroot.helm_template_absent_testrule inbazel/helm/defs.bzl, with a control string so an empty render cannot pass, and it was seen red by flipping the default.fsGroupPolicy: FileandpodInfoOnMount.kubeletRootmoves the flag, the hostPaths and the mountPaths together.kubeletRootis refused.docs/configuration.md(theudsCsivalues and theuds-csiflags), proposal 039 (Phase 1 implemented, Phase 2 pending, with a Phase 1 as built section), andCLAUDE.md.Tests: seen red, then green
Unit,
//agent/internal/udscsi:udscsi_test. With the fsGroup check replaced by agid 0fallback, andOnFailurenever called:With the real code both pass, plus the rest:
mode=2770,uid=0,gid=65532,size=1048576and flagsMS_NOSUID|MS_NODEV|MS_NOEXEC|MS_NOSYMFOLLOWInvalidArgumentfor non-ephemeral, and for each other rejectionMS_NOSYMFOLLOWretries without itGetInfofields, thenNodeGetInfoon the endpoint it names, over a real UDSbazel test --config=race //agent/internal/udscsi:allis green.Kind,
e2e/uds-csi.sh, against mutant images built from this branch:involvedObject.uidand also requires that no container ever started.mount_setattrinstead ofMS_NOSYMFOLLOW:Green on the real image:
A nightly
uds-csijob ine2e.yamlruns the same script.Also green locally:
bazel test //... --test_tag_filters=-integration: 152/152bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...(buf, buildifier, shellcheck, gocognit)make deps-auditOK. The CSI spec is a direct require,github.com/container-storage-interface/spec v1.13.0, added withbazel run @rules_go//go get+bazel mod tidy.make gazelleandmake formatleave no diffscripts/check-uds-csi-deps.shOK//agent/cmd/uds-csi:image_test(container structure) passesNot in this PR
CNIPod.uds_csi_volume, removing the emptyDir carrier, flipping the default.volume_idfor the same pod UID (proposal text). It needs state; a second volume of one pod reuses that pod's tmpfs.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr