Skip to content

fix(dra): drop redundant /sys hostPath mount breaking container start#2638

Draft
universal-itengineer wants to merge 1 commit into
mainfrom
fix/virtualization-dra-sys-mount-cgroup
Draft

fix(dra): drop redundant /sys hostPath mount breaking container start#2638
universal-itengineer wants to merge 1 commit into
mainfrom
fix/virtualization-dra-sys-mount-cgroup

Conversation

@universal-itengineer

Copy link
Copy Markdown
Member

Description

The virtualization-dra USB DaemonSet pods never start — they stay in CrashLoopBackOff on every node, so USB device passthrough is unavailable. The main container is privileged and runs with a read-only root filesystem while also bind-mounting the host /sys. Under containerd this combination makes the runtime fail to set up the /sys/fs/cgroup mount on the read-only rootfs, and the container never starts.

A privileged container already gets a read-write /sys from the runtime, so the explicit /sys mount is redundant. It is removed together with its volume and the now-dead /sys entry in the SecurityPolicy host-path allow-list.

Why do we need it, and what problem does it solve?

Without this, the DRA component cannot run at all, and USB devices cannot be passed through to VMs. Verified on a cluster: a privileged pod with a read-only rootfs and an explicit /sys mount crash-loops with the cgroup mount error, while the same pod without that mount starts fine and still has read-write access to /sys/bus/usb.

What is the expected result?

virtualization-dra pods reach Running on all nodes (no CrashLoopBackOff), and USB device passthrough works.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: vm
type: fix
summary: "USB device passthrough pods no longer fail to start on nodes with a read-only container root filesystem."

The virtualization-dra main container is privileged with readOnlyRootFilesystem
and also bind-mounts host /sys at /sys. Under containerd this makes the runtime
drop its default sysfs mount while keeping the /sys/fs/cgroup cgroup mount, which
then fails because /sys/fs cannot be created on the read-only rootfs:

  error mounting "cgroup" to rootfs at "/sys/fs/cgroup": ... mkdirat .../rootfs/sys/fs: read-only file system

A privileged container already receives a read-write /sys from the runtime
(sysfs; /sys/bus/usb is populated and writable), so the explicit /sys hostPath
volume is redundant. Remove the volume, its volumeMount, and the now-dead /sys
entry in the SecurityPolicy hostPath allow-list.

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
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.

1 participant