pci-usb-watchdog

by janip81

Helm chartv0.1.3App 0.2.0Verified publisher

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

NameEmailUrl
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

KeyTypeDefaultDescription
affinityobject{}
clusterslist[{"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.pullPolicystring"IfNotPresent"
image.repositorystring"ghcr.io/janip81/pci-usb-watchdog"
image.tagstring"latest"
imagePullSecretslist[]
metrics.portint8000
mqtt.createSecretboolfalseIf true, render a Secret from mqtt.username / mqtt.password below
mqtt.existingSecretstring""Name of an existing Secret with MQTT_USER / MQTT_PASSWORD keys. Takes precedence over createSecret.
mqtt.hoststring"mosquitto.mqtt.svc.cluster.local"
mqtt.passwordstring""
mqtt.portint1883
mqtt.topicPrefixstring"homelab/pci-watchdog"
mqtt.usernamestring""
nodeSelectorobject{}
podAnnotationsobject{}
pollIntervalSecondsint60Seconds between poll cycles
rbac.createboolfalseOnly needed if any entry in clusters sets inCluster: true
rebootCooldownSecondsint1800Minimum 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.
replicaCountint1
resources.limits.memorystring"128Mi"
resources.requests.cpustring"25m"
resources.requests.memorystring"64Mi"
service.enabledbooltrue
service.portint8000
serviceMonitor.enabledboolfalse
serviceMonitor.intervalstring"30s"
serviceMonitor.labels.releasestring"prometheus"
serviceMonitor.namespacestring""
serviceMonitor.scrapeTimeoutstring"10s"
targetslist[{"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.
tolerationslist[]

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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartpci-usb-watchdog is pinned at v0.1.3 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