ARC's autoscaling means there is normally no pre-existing "online runner" to check the way the previous design's fallback logic did (querying /orgs/{org}/actions/runners for an online match); with minRunners: 0, pods exist only while a job is running. To still support falling back to ubuntu-latest if the whole fleet goes down, heartbeat (an in-cluster Deployment - see roles/github_runner_arc/tasks/install_platform.yml) checks every HEARTBEAT_INTERVAL_SECONDS (default 180s) that a k3s node and the ARC controller are healthy and that no runner pod has been unschedulable for HEARTBEAT_UNSCHEDULABLE_AFTER_SECONDS (default: one interval), since a fleet with nowhere to place a runner only queues the work sent to it, and that every expected scale set has a listener that has been running for at least HEARTBEAT_LISTENER_SETTLE_SECONDS (default: one interval), since the controller deletes and re-creates a listener whenever its scale set's spec changes (the autoscaler's every maxRunners patch does), which drops the session with GitHub, and a job queued meanwhile can stay unassigned although the new listener is Running and runners start for other jobs, and if so, refreshes a single secret gist with a unix timestamp set HEARTBEAT_WINDOW_SECONDS (default 600s) into the future. exadev/runner-fallback-action reads that gist over the unauthenticated GitHub API and routes to exadev-runners while the timestamp is still fresh, or to ubuntu-latest otherwise. Every tick, healthy or not, it also writes fleet-health.json to the same gist (HEALTH_GIST_FILE): whether the fleet is vouched for, the reasons it is not, and any node reporting a pressure condition such as DiskPressure. A node under pressure does not make the fleet unhealthy, since the other nodes still serve jobs, but it is named there so lost capacity is visible. See that repo's docs/spec.md for the algorithm. It also writes job-peak-summary.json, the distribution of the peak memory jobs have measured (job count, how many distinct repositories they came from, the period they cover, median, 95th percentile and maximum in MiB, next to the runner pod's memory limit; the count and period are there because a large job count from one busy repository on one day says little), so whether the pods' request can come down is a lookup there and not a query of the cluster. It holds only figures, never a repository, workflow or job name, because the gist is readable by anyone holding its link.
fleet-health.json also carries deployed: the collection version each playbook scope last recorded, so a scope that a run never reached shows as behind the version the fleet repository pins instead of looking like one that is current. The ARC and platform scope (arc.yml) records it in the platform namespace's deployed-state ConfigMap at the end of a run, as platform; each server host (site.yml) annotates its own node with github-runner.exadev.com/deployed-version once the node has registered, as an entry in nodes. A host annotates only its own node, so a --limit run never claims a version for hosts it did not touch, and an agent host, which has no API of its own, records nothing and shows null. The stamp records what a run applied, not what is running: a pod that failed to start after a run still leaves the stamp, so it complements the health reasons and does not replace them. arc.yml does not touch hosts, so a release that changes the Compose directory (the docker-prune service was one) shows the nodes behind until site.yml runs.
Runs as a genuinely unpinned Kubernetes Deployment (replicas: 1, no nodeSelector), the same pattern ARC's own controller pods already use, not a host-pinned Docker Compose service — Kubernetes' own scheduler places and reschedules it on any server host with no config to move if one goes down. kubectl needs no KUBECONFIG: running as a pod with a mounted ServiceAccount token, in-cluster config is auto-detected. RBAC is scoped to exactly what it reads: cluster-wide nodes get/list, deployments get/list in the actions-runner-controller namespace, and get on the autoscaler's own status ConfigMap and the deployed-state ConfigMap by name (see Autoscaler below) — no wildcards.
Create the secret gist once:
echo "$(($(date +%s) + 600))" | gh gist create --filename arc-healthy-until --desc "ARC fleet health heartbeat" -
# put the hex id from the returned gist URL into the installing host's github_runner_arc_heartbeat_gist_id
# (or .env.bootstrap's HEARTBEAT_GIST_ID for bootstrap.sh),
# and into whatever reads it, such as runner-fallback-action's gist-id inputConfirm it refreshes: gh gist view "$HEARTBEAT_GIST_ID" must show a timestamp near now + 600, advancing roughly every 3 minutes.
runner-fallback-action reroutes silently, so nothing otherwise tells a person that the fleet has no runners. fleet-health.json carries what a notifier needs to judge how long that has lasted: at (when the heartbeat last wrote), unhealthy_since (when it stopped vouching for the fleet, null while it does) and not_ready_nodes (each node whose Ready condition is not True, whether it is a control-plane server, the regrade_level memory-pressure regrading has stepped it to if it has, and since when). The heartbeat carries each onset over from the document its previous tick published, read back from the gist, so a tick that cannot read it restarts the onsets at now, which delays an alert and never raises a false one.
scripts/fleet-alert.sh reads that document and announces an outage when any of these has held for at least FLEET_ALERT_AFTER_SECONDS (default 900, longer than the heartbeat's own 600 second window): the heartbeat has not written for that long, a control-plane server has not been Ready for that long (except one regrading has stepped down, which is not Ready on purpose), or the heartbeat has not vouched for the fleet for that long (a scale set missing or without a listener that has settled, no ready controller, no Ready node, runner pods that cannot be scheduled; the reasons are in the notification). A worker node that is not Ready is not an outage by itself. An outage is announced once, and a recovery note follows when every condition has cleared. A heartbeat image older than the onset fields makes the script fail with a message saying so, rather than never alerting.
Delivery is independent per channel, and with none configured the script only prints what it found:
| Channel | Set | Notes |
|---|---|---|
| Issue | FLEET_ALERT_ISSUE_REPO (owner/repo) and FLEET_ALERT_ISSUE_TOKEN |
Opens an issue and finds it again by a hidden marker in its body, so the open issue is the record that the outage was announced; closes it with a comment on recovery. The heartbeat's HEARTBEAT_GH_TOKEN is a gist-scoped token and cannot write issues, so this needs its own token with issue write access to that repository; a workflow's own GITHUB_TOKEN with issues: write suffices for the repository the workflow lives in. |
| Webhook | FLEET_ALERT_WEBHOOK_URL and FLEET_ALERT_STATE_FILE |
POSTs JSON: event (firing or resolved), text (a one-line summary), conditions (each with kind, detail and since) and heartbeat_at. It names no chat product, so a receiver maps text or conditions to its own format. The state file holds only whether the outage was announced; a delivery that fails is not recorded and the next pass retries. |
Both the URL and the tokens are passed to curl on its standard input, never its command line. Issue bodies name nodes and the heartbeat's reasons, so use a private repository.
Where it runs matters. A check that runs only inside the cluster cannot report that the cluster is down, and a check that runs on the fleet's own runners does not start when the fleet has no runners. So the check reads the gist, which the heartbeat writes, from outside: examples/fleet-alert/fleet-alert.yml is a scheduled workflow for a repository not served by the fleet, on a GitHub-hosted runner, and the script runs just as well from cron on any host outside the fleet. The tradeoff is that it depends on GitHub (Actions scheduling, which can be delayed and is limited to a run every five minutes, and the gist API) and on the heartbeat's write path: if GitHub is unreachable from the fleet the heartbeat goes stale and the alert fires, which is also what the fleet's users experience. It is not a cluster Deployment, deliberately. A repository with no GitHub-hosted runners available cannot use the workflow and should use cron. The workflow template keeps the webhook's state in actions/cache, which can be evicted; the worst case is one repeated announcement.