You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(disk, helm, docker): host-namespace disk inspection for containerized gpud (#1253)
## Summary
Make the GPUd disk component report the **node's real disks** when GPUd
runs inside a container (e.g. a privileged DaemonSet), and replace the
prior overlay-root workaround with a proper, configurable fix.
## Problem
Inside a container, the disk component's host tools run in the
**container's** mount namespace, so they describe the container's
overlay rootfs instead of the node:
- `findmnt --target / --json --df` returns nothing (overlay is a pseudo
filesystem that `--df` filters out) and **exits 1**, failing the disk
check.
- `lsblk` misses the node's data disks and reports empty fstypes.
- `statfs(path)` falls through to the overlay — e.g. reporting **124G
for a 2.8T** data disk.
## Change
Add configurable command overrides so the disk component can run its
host tools in the **host mount namespace** (via `nsenter`), mirroring
the existing `--reboot-commands` pattern.
**`gpud run` flags (new):** `--findmnt-commands`, `--lsblk-commands`,
`--blockdev-usage-commands`
Plumbed `cmd/gpud` → `pkg/config` → `pkg/server` → `GPUdInstance` → disk
component → `pkg/disk`.
**`pkg/disk`:**
- `FindMntWithCommand` and an `lsblk` command override (run the
configured invocation prefix; GPUd appends the flags it controls).
- A `df`-based partitions/usage path (`df -T -B1 -P`) that replaces
gopsutil enumeration + `statfs` when the override is set.
**Helm chart:**
- New `gpud.findmntCommands` / `gpud.lsblkCommands` /
`gpud.blockdevUsageCommands` values, defaulted to `nsenter --target 1
--mount -- {findmnt,lsblk,df}` and wired into the DaemonSet startup (env
+ flags), gated like `rebootCommands`.
- Document DaemonSet **reboot** and **disk inspection** configuration in
the chart README; bump chart to **v0.12.2**; note the BYOK machine-id
node label.
**Docker:** keep a runtime-stage guard verifying `findmnt` is present in
the image.
## Backward compatibility (strict invariant)
When a flag is **unset** (the default), every code path falls through to
the **exact legacy behavior** — locate `findmnt`/`lsblk` on `PATH` and
run them directly, enumerate via gopsutil, and measure usage via
`statfs`. Behavior on bare-metal / host GPUd is unchanged. Helm renders
**no** disk env/flags when a value is empty.
## Revert of the `--all` band-aid
This branch previously added `findmnt --df --all` to force the container
overlay into `--df` output. With the host-namespace fix, `findmnt
--target X --json --df` (matching `main`) works on real filesystems, and
`--all` only masked the container-overlay case with **misleading data**
(`overlay` instead of `/dev/sda1 ext4`). The default `findmnt` command
is restored to `main`'s.
## Tests
- `pkg/disk` unit tests: `df` output parser, partition filtering, option
setters, command builders, and the **empty-flag == legacy-path**
invariant.
- Validated on a live BYOK (AKS) cluster: `nsenter`-wrapped
`findmnt`/`lsblk`/`df` report the node's real ext4 root and 2.8T data
disk; `df -T -B1 -P` column order matches the parser.
- `go build` / `go vet` clean; touched-package tests pass; `helm lint`
and `helm template` (default + empty-override) verified.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Signed-off-by: Gyuho Lee <gyuhol@nvidia.com>
Usage: "bash script to run when the control plane sends a reboot request (leave empty to use the built-in sudo reboot behavior)",
205
205
Value: "",
206
206
},
207
+
cli.StringFlag{
208
+
Name: "findmnt-commands",
209
+
Usage: "command prefix used to invoke findmnt for the disk component (e.g. 'nsenter --target 1 --mount -- findmnt' to read host mounts from inside a container); leave empty to locate and run findmnt directly",
210
+
Value: "",
211
+
},
212
+
cli.StringFlag{
213
+
Name: "lsblk-commands",
214
+
Usage: "command prefix used to invoke lsblk for the disk component (e.g. 'nsenter --target 1 --mount -- lsblk' to read host block devices from inside a container); leave empty to locate and run lsblk directly",
215
+
Value: "",
216
+
},
217
+
cli.StringFlag{
218
+
Name: "blockdev-usage-commands",
219
+
Usage: "command prefix used to collect block device usage for the disk component (e.g. 'nsenter --target 1 --mount -- df' to read host disk usage from inside a container); leave empty to use the built-in gopsutil/statfs behavior",
220
+
Value: "",
221
+
},
222
+
cli.StringFlag{
223
+
Name: "containerd-service-active-commands",
224
+
Usage: "command used to check whether the containerd service is active (e.g. 'nsenter --target 1 --mount -- systemctl is-active containerd' to query the host service manager from inside a container; exit code 0 means active); leave empty to use the built-in systemd check",
225
+
Value: "",
226
+
},
207
227
cli.StringFlag{
208
228
Name: "version-file",
209
229
Usage: "specifies the version file to use for auto update (leave empty to disable auto update)",
0 commit comments