An earlier version of this repo ran a fixed number of long-lived containers via Docker Compose, cycling the GitHub runner registration between jobs (EPHEMERAL=true) but never resetting the container's own filesystem. Two problems followed: build artifacts, node_modules, and Playwright browser caches accumulated indefinitely inside the same container and filled the host's Docker disk allocation, and a fixed replica count meant jobs queued whenever more were in flight than there were replicas, with no way to burst beyond it.
ARC's gha-runner-scale-set solves both by design: it runs one fresh pod per job and deletes it afterwards, and it autoscales on queue depth. ARC needs a real Kubernetes cluster to run in. k3s ships an official Docker image that runs the whole control plane and kubelet inside one privileged container, a "cluster in a box". This makes the cluster itself just two Compose services (k3s on every control-plane host - the same service definition whether it bootstraps or joins, see the Ansible section's node-role split - and k3s-agent on a pure-worker host), portable to any machine with Docker (plus helm and kubectl on the host), with no Colima-specific flags, no separately installed kind or k3d CLI. ARC itself (the controller, the runner scale sets, and the ephemeral runner pods), plus the fleet-health platform (heartbeat/autoscaler - see Heartbeat/Autoscaler below), are not more Compose services; they're all Kubernetes-native resources installed by the Ansible role (Helm and kubernetes.core.k8s) into this cluster (see roles/github_runner_arc/).
The control plane itself runs genuine embedded-etcd HA across three server-role hosts, not a single node with worker capacity bolted on: one host bootstraps with --cluster-init (the one supported migration path from k3s's default single-node SQLite datastore to embedded etcd), and two further hosts join as full k3s server members - a real vote each in etcd's own raft quorum, not just schedulable capacity. 3 is the practical minimum: etcd tolerates the loss of any minority of its members without losing quorum, and with 2 servers that minority is zero - a second server can only ever make quorum strictly worse than staying at one, never better, so "2-node HA" isn't a real intermediate step, it's a trap. Getting there over Tailscale rather than a shared LAN needed real, non-obvious work - see the Non-obvious behaviour section's etcd-specific entries for what actually broke and why.
Hosts on different networks can't reach each other's LAN addresses, and even hosts that share a LAN can't from inside their Docker VMs by default: each node's k3s container sits behind its VM's NAT, so its own Tailscale client has no address to offer its peers and every pair of nodes is relayed. So cross-node cluster traffic (a node joining, cross-node pod-to-pod traffic, the API server's proxy to a remote kubelet, and etcd's own peer traffic between server hosts) runs over a real overlay with mesh addresses - see Tailscale below for how that overlay is built and the DNS pitfall it introduces. Where hosts do share a LAN, github_runner_cluster_network_mode: host, on a Docker VM that has an address of its own on that LAN, lets their Tailscale clients reach each other directly over it, with the relay as the fallback when a host leaves; nothing k3s uses changes (see roles/github_runner_cluster/README.md, Networking). On such hosts etcd's own peer traffic can also move onto the LAN addresses, so that a server whose mesh device stops working keeps its etcd quorum; k3s holds one etcd address per member, so the fallback to the tailnet is decided per run, not per connection (see the role README, etcd peers over the LAN).
The custom runner toolchain (GCC 11/G++ for C++20, Bun, the gh CLI — see Dockerfile) carries over from the previous design, rebased onto ARC's own actions/actions-runner base image instead of catthehacker/ubuntu:act-latest. ARC's runner pods use their own registration flow, so the previous design's vendored myoung34/docker-github-actions-runner scripts (registration, GitHub App JWT signing, ephemeral re-registration) are not needed.
The images are built on GitHub-hosted runners rather than on the fleet, so a broken image can never take down the pool it would need to be rebuilt on. See Releases below for how a release builds them.
.github/workflows/ci.yml, mesh-integration.yml and litestream.yml run on GitHub-hosted ubuntu-latest, which is free for a public repository, so checking the fleet's configuration never depends on the fleet itself being up. test-arc-runner.yml and test-autoscaler.yml are the ones that target the fleet, since the fleet's own behaviour is what they test.
Each node's k3s process joins a Tailscale tailnet as its own device, using k3s's own built-in (experimental) --vpn-auth integration: --vpn-auth="name=tailscale,joinKey=<key>" on both k3s server and k3s agent. This runs Tailscale inside the k3s container/process itself, separate from the host machine's own Tailscale identity if it has one, and flannel uses Tailscale's own subnet-route advertisement for pod-to-pod traffic instead of its usual VXLAN encapsulation - no manual --node-ip, no Docker port-publishing, no host-level Tailscale dependency at all. The Mac's own Tailscale client, if it has one, is a separate device that this collection does not manage. A native node (a Linux host with github_runner_cluster_node_mode: native, which has no container to put a client in) is the exception: the host's own Tailscale client is the node's device, and the host is dedicated to the cluster; roles/github_runner_cluster/README.md's Native nodes section says why. k3s/Dockerfile layers the tailscale/tailscaled binaries from the official Tailscale image onto rancher/k3s's own minimal base (which has no package manager to install them at runtime), and k3s/node-entrypoint.sh (the Compose services' entrypoint, bind-mounted from the node's Compose project directory; both live in roles/github_runner_cluster/files/) starts tailscaled itself before execing k3s, since k3s's vpn-auth integration only runs tailscale up and assumes the daemon is already running.
The mesh's control server does not have to be Tailscale's. The cluster role's github_runner_cluster_mesh switches it to Headscale: a server someone else runs, one the role runs under Compose outside k3s, or one it runs inside the cluster itself; see roles/github_runner_cluster/README.md. The rest of this section describes the default, Tailscale.
Provisioning the join key: create a reusable, pre-authorized Tailscale auth key (Tailscale admin console → Settings → Keys, or the POST /api/v2/tailnet/-/keys API), tag it so an ACL grant can target it, and set K3S_VPN_AUTH_JOIN_KEY in every host's .env (or, via Ansible, set github_runner_cluster_tailscale_join_key, which the 1Password adapter reads from a tailscale-join-key field, as roles/github_runner_secrets_onepassword/README.md describes). The tailnet's ACL needs a grants entry permitting traffic between the nodes' own tag and the pod CIDR itself (e.g. 10.42.0.0/16), not just the tag - Tailscale evaluates a subnet-routed packet's actual embedded source IP, not just the sending device's identity, so a grant scoped to the tag alone silently blocks cross-node pod traffic (k3s-io/k3s#8372).
Tailscale's own DNS management is a real trap here. By default (--accept-dns=true, Tailscale's own default), tailscale up overwrites the container's /etc/resolv.conf with MagicDNS's resolver (a fixed, well-known 100.100.100.100) plus whatever search domains the tailnet's own DNS settings configure - which can include search domains meant for entirely unrelated, personal use of the same tailnet. Kubernetes' dnsPolicy: ClusterFirst then copies the node's search domains into every pod's own /etc/resolv.conf alongside the cluster's own three, and the default ndots:5 means a pod's resolver tries every search-suffixed name before the bare hostname for anything with fewer than 5 dots - which is essentially every real-world hostname. If any of those inherited search domains carries a wildcard DNS record, a pod's lookup of a real external hostname can resolve to that wildcard's target instead, while the application still sends the original hostname as its TLS SNI - silent certificate-verification failures for arbitrary outbound HTTPS traffic, indistinguishable at a glance from a hung network. Both k3s server/k3s agent invocations set --resolv-conf to a synthetic file containing only nameserver 100.100.100.100 and no search domains, so pods still resolve everything correctly through Tailscale's own DNS proxy without inheriting a search list they have no use for.