一个 Kubernetes 设备插件,用于安排通用 Linux 设备
The generic-device-plugin enables allocating generic Linux devices, such as serial devices, the FUSE device, or video cameras, to Kubernetes Pods. This allows devices that don't require special drivers to be advertised to the cluster and scheduled, enabling various use-cases, e.g.:
privileged.The generic-device-plugin can be configured to discover and allocate any desired device using the --device flag.
For example, to advertise all video devices to the cluster, the following flag could be given:
--device='{"name": "video", "groups": [{"paths": [{"path": "/dev/video0"}]}]}'Now, Pods that require a video capture device, such as an object detection service, could request to be allocated one using the Kubernetes Pod resources field:
resources:
limits:
devic.es/video: 1The --device flag can be provided multiple times to allow the plugin to discover and allocate different types of resources.
To install the generic-device-plugin, choose what devices should be discovered and deploy the included DaemonSet:
kubectl apply -f https://raw.githubusercontent.com/squat/generic-device-plugin/main/manifests/generic-device-plugin.yamlNote: the example manifest included in this repository discovers serial devices, the /dev/video0 device, the /dev/fuse device, sound devices, and sound capture devices.
Now, deploy a workload that requests one of the newly discovered resources. For example, the following script could be used to run a Pod that creates an MJPEG stream from a video device on the node:
…暂无开放 Issues,或尚未同步最近议题。