Your first Automation
Your first automation
Section titled “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/v1alpha1kind: Automationmetadata: name: pause-downloads-on-backup-wan namespace: mediaspec: 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: 1kubectl -n media get automation# NAME PROVIDER MATCHING SUSPENDED READY AGE# pause-downloads-on-backup-wan unifi false false True 12sShedding load during a power cut is the same shape, matching ups: on-battery instead.
Where to go next
Section titled “Where to go next”- The two shapes an action has — why some actions are arbitrated and some just fire.
- Kubernetes actions — suspending a CronJob, cordoning a node, restarting a workload.
- State keys — everything else Reactor can match on.
- Suspend and dry run — how to ask an Automation what it would do before letting it do it.
- Automation API reference — every field of
specandstatus, its type, and what it accepts.