pci-usb-watchdog
by janip81
Detects PCI-passthrough USB device failures (e.g. Coral Edge TPU, Zigbee dongles) across one or more Kubernetes clusters and alerts via Prometheus + MQTT
About this chart
pci-usb-watchdog
Detects PCI-passthrough USB device failures (e.g. Coral Edge TPU, Zigbee dongles) across one or more Kubernetes clusters and alerts via Prometheus + MQTT
Homepage: https://github.com/janip81/helm-charts/tree/main/charts/pci-usb-watchdog
Maintainers
| Name | Url | |
|---|---|---|
| janip81 | [email protected] | https://github.com/janip81 |
Source Code
Overview
Helm chart for deploying pci-usb-watchdog: a small poller that watches Kubernetes workloads whose containers depend on a PCI-passthrough USB device (e.g. a Coral Edge TPU used by Frigate, a Zigbee/Zwave USB dongle) and alerts via Prometheus metrics and MQTT when the device's workload goes unhealthy -- catching the class of failure where the passthrough USB controller dies on the hypervisor side and the container just crash-loops with no clear signal until someone notices.
Each entry in clusters needs exactly one of kubeconfigSecret (mount an
existing kubeconfig Secret already living in this release's namespace -- e.g. a
CAPI-generated <cluster>-kubeconfig Secret) or inCluster: true (use this
pod's own ServiceAccount, requires rbac.create: true).
Adding this helm repository
To add the helm repository, run the following commands:
helm repo add janip81 https://janip81.github.io/helm-charts/
helm search repo pci-usb-watchdog
values.yaml files for the charts can be found in the charts/[chartname] directories.
TL;DR
helm repo add janip81 https://janip81.github.io/helm-charts/
helm install my-app-name janip81/pci-usb-watchdog -f YOUR-OWN-VALUES.yaml
Helm must be installed to use the charts. Please refer to Helm's documentation to get started.
If you had already added this repo earlier, run helm repo update to retrieve
the latest versions of the packages. You can then run helm search repo <alias> to see the charts.
To install the chart:
helm install my-<chart-name> <alias>/<chart-name>
To uninstall the chart:
helm delete my-<chart-name>
Prerequisites
Values
| Key | Type | Default | Description |
|---|---|---|---|
| affinity | object | {} | |
| clusters | list | [{"kubeconfigSecret":{"key":"value","name":"prod-k8s-kubeconfig"},"name":"prod-k8s","node":"prod-k8s-pci-node-6xx5v-krjsp"}] | Clusters this watchdog can watch. Each cluster needs exactly one of kubeconfigSecret (mount an existing kubeconfig Secret, e.g. a CAPI-generated <cluster>-kubeconfig Secret already living in this release's namespace) or inCluster: true (use this pod's own ServiceAccount -- requires rbac.create: true). |
| image.pullPolicy | string | "IfNotPresent" | |
| image.repository | string | "ghcr.io/janip81/pci-usb-watchdog" | |
| image.tag | string | "latest" | |
| imagePullSecrets | list | [] | |
| metrics.port | int | 8000 | |
| mqtt.createSecret | bool | false | If true, render a Secret from mqtt.username / mqtt.password below |
| mqtt.existingSecret | string | "" | Name of an existing Secret with MQTT_USER / MQTT_PASSWORD keys. Takes precedence over createSecret. |
| mqtt.host | string | "mosquitto.mqtt.svc.cluster.local" | |
| mqtt.password | string | "" | |
| mqtt.port | int | 1883 | |
| mqtt.topicPrefix | string | "homelab/pci-watchdog" | |
| mqtt.username | string | "" | |
| nodeSelector | object | {} | |
| podAnnotations | object | {} | |
| pollIntervalSeconds | int | 60 | Seconds between poll cycles |
| rbac.create | bool | false | Only needed if any entry in clusters sets inCluster: true |
| rebootCooldownSeconds | int | 1800 | Minimum time between two auto-reboots of the SAME node, regardless of how many targets on that node ask for a reboot or how many times the same target re-confirms unhealthy. Guards against reboot-looping a node whose hardware fault a reboot doesn't actually fix. |
| replicaCount | int | 1 | |
| resources.limits.memory | string | "128Mi" | |
| resources.requests.cpu | string | "25m" | |
| resources.requests.memory | string | "64Mi" | |
| service.enabled | bool | true | |
| service.port | int | 8000 | |
| serviceMonitor.enabled | bool | false | |
| serviceMonitor.interval | string | "30s" | |
| serviceMonitor.labels.release | string | "prometheus" | |
| serviceMonitor.namespace | string | "" | |
| serviceMonitor.scrapeTimeout | string | "10s" | |
| targets | list | [{"autoReboot":true,"cluster":"prod-k8s","device":"Coral Edge TPU","namespace":"frigate","signatures":["No EdgeTPU was detected","HC died"],"workloadKind":"Deployment","workloadName":"frigate"},{"cluster":"prod-k8s","device":"Sonoff Zigbee Dongle","namespace":"zigbee2mqtt","signatures":[],"workloadKind":"StatefulSet","workloadName":"zigbee2mqtt"}] | Workloads to watch for PCI-passthrough USB device failures. signatures is a list of case-sensitive substrings matched against container logs; an empty list means "watch for crashes/restarts but there's no known log signature to confirm the root cause yet" (still alerts, with reason=unknown). autoReboot (default false) reboots the node when a poll confirms one of signatures -- never on reason=unknown. Only makes sense for a failure mode already confirmed to need a real host reboot, not just a pod restart. |
| tolerations | list | [] |
Autogenerated from chart metadata using helm-docs v1.14.2
Deploy pci-usb-watchdog with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has pci-usb-watchdog 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartpci-usb-watchdog is pinned at v0.1.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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