rpi4-v4l2-device-plugin

by lbenicio

Helm chartv0.1.0App 0.2.0Verified publisher

Allocate Raspberry Pi 4 V4L2 H.264 decoder and encoder devices to Kubernetes workloads.

About this chart

Raspberry Pi 4 V4L2 Device Plugin

This chart installs the upstream generic Kubernetes device plugin and exposes only the Raspberry Pi 4 H.264 decoder (/dev/video10) and encoder (/dev/video11) as one schedulable resource. It does not mount the rest of the host's /dev directory.

Kubernetes requires device-plugin pods to access the kubelet device-plugin socket. The plugin pod therefore runs privileged, while consuming applications receive only the paired video devices allocated through the extended resource. The chart disables service-account token mounting, grants no Kubernetes API RBAC, and sets CPU and memory requests and limits. Restrict its node affinity to nodes with these Pi devices and tolerate only the taints required by those nodes.

Install

helm upgrade --install rpi4-v4l2-device-plugin \
  lbenicio-community/rpi4-v4l2-device-plugin \
  --version 0.1.0 \
  --namespace default \
  --values values.yaml \
  --rollback-on-failure --wait --timeout 5m

After the plugin registers with kubelet, a workload requests one paired device with this resource limit:

resources:
  limits:
    devic.es/rpi4-v4l2m2m: 1

Kubernetes schedules that pod only on a node advertising the device. The plugin then supplies the two device nodes and their device-cgroup permissions.

Values

KeyDefaultDescription
image.repositorysquat/generic-device-pluginUpstream plugin image repository.
image.tagf7c3291Pinned upstream commit tag.
image.pullPolicyIfNotPresentImage pull policy.
resourceDomaindevic.esExtended-resource domain.
resourceNamerpi4-v4l2m2mName of the paired device resource.
resourcesSee values.yamlPlugin pod CPU and memory requests and limits.
nodeSelector{}Node selector for nodes with both V4L2 devices.
affinity{}Node affinity for nodes with both V4L2 devices.
tolerations[]Tolerations for node taints.
podLabels{}Additional pod labels.
podAnnotations{}Additional pod annotations.

Deploy rpi4-v4l2-device-plugin with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has rpi4-v4l2-device-plugin on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartrpi4-v4l2-device-plugin is pinned at v0.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply