Sub topic 3
Actions Runner Controller in context
This chapter places Actions Runner Controller (ARC) among the other ways to run GitHub Actions jobs. It explains what ARC does that a hand-managed runner doesn't, and where its limits are. It assumes you know the following:
- GitHub Actions workflows, including
runs-on - Kubernetes pods, namespaces, and controllers
- Why a runner should be ephemeral, as covered in the previous chapter
Installation comes later. This chapter is about the model.
What ARC is
Actions Runner Controller is a Kubernetes operator that GitHub maintains. An operator is a controller that watches custom resources and creates or deletes other Kubernetes objects to match them. ARC watches for queued workflow jobs and creates one runner pod per job. When the job finishes, the pod is deleted.
You don't register runners yourself. You describe a pool, called a runner scale set, with a minimum and a maximum size. ARC grows and shrinks the pool between those bounds.
ARC is not a hosted service. The runner pods run on your cluster, with your network access, your node types, and your bill. GitHub supplies the orchestration code and the job queue. You supply the compute.
Three ways to get a runner
A job can run on one of three kinds of runner:
- GitHub-hosted runners. GitHub provisions a fresh virtual machine for each job. You manage nothing, but you can't reach private networks without extra setup, and you pick from GitHub's machine sizes.
- Static self-hosted runners. You install the runner application on a machine you own, register it with
config.sh, and keep it running. The machine stays up between jobs. - ARC runners. You describe a pool in Helm values. ARC creates runner pods when jobs arrive and removes them afterward.
| Property | GitHub-hosted | Static self-hosted | ARC |
|---|---|---|---|
| Who provisions compute | GitHub | You, by hand or with your own tooling | Kubernetes, driven by ARC |
| Clean environment per job | Yes | Only if you build it | Yes, one pod per job |
| Idle cost | None | Full machine cost | Zero at `minRunners: 0` |
| Scaling | Managed by GitHub | You add and remove machines | Automatic, between your min and max |
| Access to private networks | Needs extra setup | Native | Native to the cluster network |
| Operational burden | Lowest | High | Medium: you run a cluster and a Helm release |
The static column shows the problems ARC addresses. A long-lived runner keeps files, credentials, and processes from earlier jobs. A job can leave behind a modified tool or a cached secret, and the next job inherits it. Capacity is also fixed. With five machines, a sixth concurrent job waits even if the cluster has spare capacity elsewhere, and at night all five machines sit idle but still cost money.
What the controller automates
With static runners, a person or a script does these tasks. With ARC, the controller does them.
- Registration. Each runner pod registers with GitHub for a single job. You don't distribute registration tokens to machines.
- Capacity matching. ARC compares the number of jobs GitHub has assigned or queued with the number of runners it holds. It creates pods to close the gap.
- Cleanup. After a job, the pod is removed. A runner that exits without finishing doesn't leave an orphan registration for you to delete by hand.
- Isolation. Each job gets a new pod with its own filesystem and processes.
Your workflow files keep the same steps. Only runs-on changes:
name: Compare runner targets
on: workflow_dispatch
jobs:
static-runner:
# Matches runners that carry all of these labels
runs-on: [self-hosted, linux, x64]
steps:
- run: echo "Static runner, state may persist from earlier jobs"
arc-runner:
# Matches the runner scale set by its Helm installation name
runs-on: arc-runner-set
steps:
- run: echo "Fresh pod, removed when this job ends"With a static runner, you match a set of labels. With a scale set, you use a single value, the name you gave the Helm installation. If the job's runs-on doesn't match that name, ARC never sees the job and it waits in the queue.
How ARC learns about jobs
The way ARC finds out about jobs is one of the biggest differences from the older approach, so it is worth stating here. A later chapter covers the mechanism in detail.
ARC does not require GitHub to call into your cluster. For each scale set, ARC runs a small pod called a listener. The listener makes an outbound HTTPS connection to GitHub and long-polls for messages about the scale set's job queue. When it learns that more runners are needed, it tells the controller to change the desired runner count.
This has practical consequences:
- You don't expose an ingress or a public webhook endpoint.
- Clusters behind a firewall work as long as they allow outbound HTTPS to GitHub.
- There is no webhook secret to rotate and no delivery failures to replay.
Two projects share one name
Two separate projects are called "Actions Runner Controller", which causes confusion when you read blog posts or search for issues.
- Runner scale set mode. This is the GitHub-supported ARC, the one this tutorial uses. You install it with the
gha-runner-scale-set-controllerandgha-runner-scale-setHelm charts fromghcr.io/actions. Its custom resources includeAutoscalingRunnerSet,EphemeralRunnerSet, andEphemeralRunner. - Legacy community ARC. This is the earlier
summerwind/actions-runner-controllerproject. It uses resources such asRunnerDeploymentandHorizontalRunnerAutoscaler, and it can scale from webhook events or by polling.
What ARC does not do for you
ARC removes a lot of work, but several responsibilities stay with you.
- The cluster. ARC needs a working Kubernetes cluster with enough node capacity. If the nodes are full, runner pods stay
Pendingand jobs wait. ARC doesn't add nodes by itself. Pair it with a node autoscaler if you need elastic capacity. - Startup latency. At
minRunners: 0, the first job after an idle period waits for a pod to be scheduled, its image pulled, and the runner to register. Warm capacity (minRunnersabove zero) trades money for lower latency. The scaling chapter covers this trade-off. - Credentials. ARC needs permission to talk to GitHub, using either a personal access token or a GitHub App. You create and protect that credential.
- Container builds. Jobs that run
docker buildneed a container mode. Each mode has security and complexity costs. - Platform limits. Runner pods are Linux containers. If you need Windows or macOS runners, you need a different approach.
Where ARC fits in this tutorial
The overview gives you the vocabulary. The following chapters fill in the details in this order:
- How the controller, scale set, listener, and runner pods interact.
- Authentication with a personal access token or a GitHub App.
- Installing the controller, then a scale set.
- Targeting the scale set from a workflow and tuning its size.
Authentication comes before installation because the scale set chart needs a credential at install time.
Exercise
A teammate has a workflow with runs-on: [self-hosted, linux, x64]. They install an ARC runner scale set named build-pool and the jobs still run on the old static machines. What do they need to change for jobs to run on ARC, and why?
Show answer
Change runs-on to build-pool, the Helm installation name of the scale set. ARC listens for jobs that target that exact name. A label list like [self-hosted, linux, x64] still matches the static runners, so the jobs keep going there and ARC never sees them.
Exercise
Your cluster sits behind a firewall that allows outbound HTTPS but accepts no inbound connections from the internet. Can you run ARC in scale set mode, and why?
Show answer
Yes. The listener opens an outbound long-poll connection to GitHub to receive job information, so no inbound webhook endpoint is needed. The firewall only has to allow outbound HTTPS to GitHub.
Exercise
At 02:00 no jobs are running, and minRunners is 0. List what the cluster is running for this scale set, and say what happens to the first job that arrives.
Show answer
The controller and the scale set's listener pod are running, but no runner pods exist. When the first job arrives, the listener reports the demand and the controller creates a runner pod. The job waits while the pod is scheduled, its image is pulled, and the runner registers, so it starts later than it would with warm runners. Setting minRunners above 0 would avoid that wait at the cost of idle pods.