Skip to content

fix(uds-csi): cap each per-pod tmpfs at nr_inodes (default 64) (#1107) - #1111

Merged
bpalermo merged 1 commit into
mainfrom
fix/1107-uds-csi-inode-cap
Oct 1, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/1107-uds-csi-inode-cap

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 1, 2026

Copy link
Copy Markdown
Owner

What

Proposal 039 designs the per-pod tmpfs with size=<small>,nr_inodes=<small>. Phase 1 as built (#1090) passed only mode=2770,uid=0,gid=<fsGroup>,size=<bytes>, so the inode cap was the kernel default of half the node's RAM pages. 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, enforced in NewDriver). The mount data string is now exactly mode=2770,uid=0,gid=<fsGroup>,size=<bytes>,nr_inodes=<n>.
  • chart: new value udsCsi.inodes (default 64). It renders --inodes as a plain integer, so a YAML 1000000 never turns into 1e+06, and the install fails below 8 instead of leaving a crash-looping DaemonSet. Chart version 2.1.0 (a new value).
  • e2e/uds-csi.sh: new assert_inode_cap, run for the publish pod and the after-roll pod. It checks four things:
    • findmnt -o OPTIONS on the kind host shows nr_inodes=64.
    • df reports 64 inodes.
    • Filling /s fails with ENOSPC.
    • After that, 0 inodes are free and the already-bound socket still answers.
  • docs: configuration.md (the value and the flag) and the proposal's Phase 1 as built bullet. The Gate bullet there now mentions the cap too.

Evidence

  • Unit test failed before the fix. TestTmpfsData and TestNodePublishVolume_MountsPerPodTmpfsAndBindsIt both failed with expected "...size=1048576,nr_inodes=64" / actual "...size=1048576". They pass with the fix.
  • bazel test //agent/internal/udscsi:all //agent/cmd/uds-csi:all //charts/aether:all: 46/46 pass. That includes the new aether_uds_csi_inodes_too_small_test and the --inodes=64 / --inodes=1000000 patterns. TestChartFlagsExist checks that the chart's --inodes exists in the binary.
  • e2e/uds-csi.sh on kind (UDS_CSI_CLUSTER=udscsi-1107) passed all assertions:
    ✓ with-fsgroup: /s is the plugin's tmpfs (tmpfs /s tmpfs rw,relatime,size=1024k,nr_inodes=64,mode=2770,gid=65532,inode64 0 0)
    ✓ host: /run/aether/uds/<uid> is capped at 64 inodes (61 free; options rw,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=64,mode=2770,gid=65532,inode64)
    ✓ with-fsgroup: file 62 on /s failed with ENOSPC (No space left on device); 0 inodes free and the socket still answers
    ✓ after-roll: ... (same after a plugin rollout restart)
    ==> all assertions passed
    
    The root directory, a.sock and the symlink leg's link take the other 3 of the 64 inodes.
  • make format produced no diff. bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //... is clean.

Rollout note

A running pod keeps its existing (uncapped) tmpfs. The cap applies to mounts the plugin makes after this rolls out, which in practice means pods (re)created after the upgrade.

Closes #1107

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

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

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit 9a4426c into main Oct 1, 2026
24 checks passed
@bpalermo
bpalermo deleted the fix/1107-uds-csi-inode-cap branch October 1, 2026 17:32
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]>
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.

uds-csi: the per-pod tmpfs has a size cap but no inode cap (nr_inodes)

1 participant