How to add a USB device to the Kubernetes cluster¶
generic device plguin¶
TODO
Akri (depreciated)¶
This guide shows how to expose a USB device (for example a Zigbee stick) to your K3s cluster using Akri.
1. Find device info on the node¶
On the node where the USB device is plugged in:
udevadm info --name=/dev/<device> --attribute-walk | grep -E 'idVendor|idProduct'
2. Create / update Akri Configuration¶
Create an Akri Configuration that matches your device. Example (adjust idVendor, idProduct, and resource name):
apiVersion: akri.sh/v0
kind: Configuration
metadata:
name: zigbee
spec:
discovery:
udev:
- idVendor: "10c4"
idProduct: "ea60"
capacity: 1
resource:
name: akri.sh/zigbee
Akri will start discovering devices matching this rule and create Instances.
3. Use the device in a pod¶
Once the Akri agent sees the device and the node reports a non-zero allocatable count for the Akri resource, you can bind pods to that resource via Akri Configuration/Instance.
Example pod snippet:
apiVersion: v1
kind: Pod
metadata:
name: zigbee-consumer
spec:
containers:
- name: app
image: your-image
resources:
requests:
akri.sh/zigbee: 1
limits:
akri.sh/zigbee: 1