Building UniFi Reactor: state-driven network automation for my Kubernetes homelab Robbe Verhelst built UniFi Reactor, a Kubernetes operator that watches UniFi Network state and turns it into declarative cluster automations. The operator polls the UniFi Network API, normalizes the state into keys, and reconciles Kubernetes Automation resources, enabling actions like scaling down ML workloads when the UPS is on battery or pausing downloads on backup WAN. A few weeks ago I added a UPS and backup internet to my homelab. That solved one class of problem, but it made another one more obvious. My UniFi gear knew when the WAN failed over. It knew when the UPS switched to battery. Kubernetes did not. So if the main WAN failed at 3 AM, qBittorrent could keep happily seeding over a metered backup link. If power dropped, the UPS could be counting down its remaining runtime while the cluster continued doing background ML jobs, backups, and other work that absolutely did not need to happen during an outage. That felt wrong. The network already had the state. The cluster just needed to react to it. That is why I built UniFi Reactor https://github.com/robbeverhelst/unifi-reactor : a Kubernetes operator that watches UniFi Network state and turns it into declarative cluster automations. Docs are here: reactor.robbeverhelst.com https://reactor.robbeverhelst.com/ UniFi Reactor polls the UniFi Network API, normalizes what it sees into state keys, and reconciles Kubernetes Automation resources against those keys. Examples of state keys: wan: primary or wan: backup internet: ok , degraded , or down ups: online or on-battery ups.battery: normal , low , or critical devices: all-online or degraded device.