Architecture#
Unlike a typical Kubernetes device driver where devices are locally available on a Node and everything can be handled by a single plugin DaemonSet, this driver is split into three components to support remote USB devices via USB/IP.
Agent#
The Agent runs on a machine outside the cluster – for example a Raspberry Pi – that has physical USB devices connected. It:
Discovers locally connected USB devices using
usbip list --localOptionally binds devices to the
usbip-hostdriverServes device metadata as JSON over HTTP on port 13240
The Agent is a standalone Go binary, not a container, since it needs direct access to host USB devices and kernel modules.
Manager#
The Manager runs as a single pod inside the cluster. It:
Polls one or more Agents to discover available USB devices
Creates and updates Kubernetes
ResourceSliceobjects representing those devices, with attributes like vendor ID, product ID, and serial numberUses the DRA resource slice controller to keep slices in sync
Plugin#
The Plugin runs as a DaemonSet on each node in the cluster. When the Kubelet assigns a USB device to a pod, the Plugin:
Attaches the remote device using
usbip attachWaits for the device to appear locally via the VHCI driver
Creates a CDI (Container Device Interface) spec file so the container runtime mounts the device node into the pod
Persists state to a checkpoint file so it can detach devices when the pod terminates
Data flow#
Agent exposes device metadata via HTTP
Manager polls Agents and publishes ResourceSlices to the API server
User creates a ResourceClaim; the scheduler matches it against ResourceSlices
Kubelet calls the Plugin to prepare the claim
Plugin attaches the device via USB/IP and creates CDI specs
Container runtime uses CDI specs to mount the device into the pod