Skip to content

Your first Automation

Pause downloads while the WAN is on the backup uplink, and resume them when it recovers — one resource covers both directions:

apiVersion: reactor.robbeverhelst.com/v1alpha1
kind: Automation
metadata:
name: pause-downloads-on-backup-wan
namespace: media
spec:
when:
provider: unifi
state:
wan: backup
actions:
- type: kubernetes.scale
target: { kind: Deployment, name: qbittorrent }
replicas: 0
onExit:
- type: kubernetes.scale
target: { kind: Deployment, name: qbittorrent }
replicas: 1
Terminal window
kubectl -n media get automation
# NAME PROVIDER MATCHING SUSPENDED READY AGE
# pause-downloads-on-backup-wan unifi false false True 12s

Shedding load during a power cut is the same shape, matching ups: on-battery instead.