I put together a small Proxmox LXC module that handles graceful shutdown outside the Kubernetes cluster during a UPS event.
The main goal was to reduce power draw during an outage while keeping Home Assistant, which is running in Kubernetes, available for as long as possible. The shutdown coordinator stays outside the cluster it protects, polls an existing NUT server, can set Ceph noout, shut down Talos nodes, shut down generic Linux nodes over SSH, and then shut down selected Proxmox nodes based on remaining UPS runtime.
It also publishes MQTT state and Home Assistant discovery, so Home Assistant can show the current UPS status, runtime, shutdown stage, and recovery state without a lot of custom wiring.
Main pieces:
-
Proxmox LXC deployed with Terraform
-
NUT polling for UPS status and runtime
-
staged Ceph, Talos, generic Linux, and Proxmox shutdown flow
-
recovery helper that clears Ceph
nooutafter power returns -
Home Assistant examples for dashboard, package, and automations
Repo/module:
-
Repo: GitHub - FriedCircuits/terraform-modules: Hodgepodge of Terraform modules. · GitHub
-
modules/proxmox/shutdown-controller
Home Assistant examples:
modules/proxmox/shutdown-controller/examples/home-assistant
Dashboard image:
If anyone else is doing homelab or small-cluster power-loss handling with Home Assistant, I’d be interested in how you’re sequencing shutdown and recovery.
