Actions Runner Controller (ARC) is a Kubernetes operator that runs and scales GitHub Actions self-hosted runners. The mode GitHub supports today is runner scale set mode: each job gets its own runner pod, and ARC deletes the pod when the job finishes. Runners on a VM stay up permanently; in scale set mode the pod count drops to zero when there is no work.

I wanted to know what happens between a job entering GitHub’s queue and a pod running it inside the cluster, and which component does what along the way. I checked the scale set mode docs in the ARC repository and the official GitHub docs; the latest release at the time of writing is gha-runner-scale-set-0.15.1. The flow comes down to two connections. The listener only receives the signal that a job has arrived, and the runner fetches the job itself from GitHub.

Components

ARC ships as two Helm charts. gha-runner-scale-set-controller deploys the controller manager pod, and gha-runner-scale-set creates an AutoscalingRunnerSet, the resource that defines one set of runners. To run several scale sets, install the second chart several times.

ARC runner scale set componentsGitHub Actions ServiceKubernetes clustercontroller manager(gha-runner-scale-set-controller)AutoscalingRunnerSet(gha-runner-scale-set)AutoscalingListenerlistener podEphemeralRunnerSetreplicas: NEphemeralRunner × None runner pod eachpatch replicasAPI: register scale set, JIT tokenlong poll: Job Availablelong poll: job details; logs

The controller manager contains one controller per resource kind, and each controller creates its child resources. All of them are custom resources in the actions.github.com/v1alpha1 API group.

  • AutoscalingRunnerSet: the top-level resource for one scale set. It registers a runner scale set with GitHub and creates the AutoscalingListener and the EphemeralRunnerSet
  • AutoscalingListener: defines the listener pod. The listener holds a connection to GitHub’s Actions Service and waits for jobs
  • EphemeralRunnerSet: holds the desired runner count (replicas). The listener changes this value
  • EphemeralRunner: a single runner, backed by one runner pod

Job Lifecycle

The ARC docs describe the flow in eleven steps. I grouped them into four phases: setup, scale-up, execution, and cleanup.

ARC job lifecycleSetupfetch or create scale setcreate listener podopen long pollScale-upJob Availablepatch EphemeralRunnerSet replicasrequest JIT tokencreate runner podExecutionregister with JIT token, long pollsend job detailsstream logs and statusCleanupcheck that runner can be removeddelete EphemeralRunner and podActions Servicelistenercontrollerrunner pod

Setup

When an AutoscalingRunnerSet is created, the controller calls the GitHub API to look up the runner group the scale set belongs to, then fetches or creates the runner scale set in the Actions Service. After that it starts the listener pod.

The listener authenticates with the Actions Service and opens an HTTPS long poll connection. It then waits for a Job Available message. No runner pods need to exist at this point.

Scale-up

When a workflow runs, the Actions Service assigns each job to a runner or scale set that matches its runs-on value. You can target a scale set by its installation name (runnerScaleSetName) or by labels set through the chart’s scaleSetLabels.

On a Job Available message, the listener acquires as many jobs as it has capacity for. It then patches the EphemeralRunnerSet replicas through the Kubernetes API, using a dedicated Service Account and Role for that call. The listener acknowledges a message only after this handling succeeds, so a failure partway through can be retried.

As replicas go up, new EphemeralRunner resources appear. The controller requests a JIT (just-in-time) configuration token from the Actions Service and creates the runner pod. If a pod enters the failed state, the controller retries up to five times. If no runner picks up the job, the Actions Service unassigns it after 24 hours.

Execution

The runner application inside the pod registers itself with the Actions Service using the JIT token. It opens its own long poll connection, separate from the listener’s, to receive the job details. While the job runs, it streams logs and status back to the Actions Service.

Registration uses only this JIT token. The PAT (personal access token) or GitHub App token that ARC uses to authenticate to the GitHub API never reaches the runner pod, and the ARC docs list this as an improvement over legacy mode. The pod that runs workflow code holds none of ARC’s credentials.

Cleanup

When the job completes successfully, the controller asks the Actions Service whether the runner can be removed, and the EphemeralRunnerSet deletes it. Each runner runs exactly one job, so the next job starts in a newly created runner pod.

Scaling

During scale-up, the listener’s target runner count is minRunners plus the number of jobs currently assigned, capped at maxRunners.

  • With neither set, ARC scales up to the number of jobs and back down to zero when there are none
  • With minRunners set, that many runners stay idle even with no jobs. Those pods hold their resources the whole time
  • minRunners cannot exceed maxRunners

The scaling signal comes from the messages the listener receives. ARC does not poll the GitHub API to compute a target.

Differences from Legacy Mode

ARC also has an older mode built on the actions.summerwind.dev API group, now called legacy mode. It defines runners with RunnerDeployment or RunnerSet and scales them with HorizontalRunnerAutoscaler. After runner scale set mode reached general availability in 2023, GitHub announced that it supports only the new mode, and the community maintains legacy mode.

AspectLegacy modeRunner scale set mode
Scaling signalPeriodic GitHub API polling, or workflow_job webhooksLong poll messages to the listener
Runner registrationPAT or GitHub App token passed to the runner podJIT token obtained by the controller
Prerequisitecert-managerNo cert-manager
Supported byCommunityGitHub

Polling mode computes metrics such as TotalNumberOfQueuedAndInProgressWorkflowRuns and PercentageRunnersBusy through the GitHub API on every sync. The legacy docs warn that a shorter sync period consumes the API rate limit faster.

Webhook mode runs a separate webhook server that scales on workflow_job events. In exchange, GitHub’s webhooks have to reach that server inside the cluster.

In runner scale set mode the listener opens an outbound connection to GitHub, so the cluster needs no inbound path.

containerMode

If a workflow uses container: jobs, services:, or container actions, the runner needs a way to start containers. The containerMode value in the gha-runner-scale-set chart decides how.

ARC containerMode comparisondindrunner podrunnerdindprivilegedjob containerDocker socketkubernetesrunner podrunner+ container hooksjob podjob containercreate podpersistent volume(work directory)kubernetes-novolumerunner podrunner+ container hooksjob podjob containercreate podlifecycle hooks restoreand export filesystem
  • dind (Docker-in-Docker): adds a docker:dind container to the runner pod, and the runner uses that Docker daemon. The daemon requires privileged mode
  • kubernetes: runner container hooks create the job container as a separate pod in the same namespace. It needs a persistent volume so the runner pod and the job pod share the work directory
  • kubernetes-novolume: also creates a separate pod, but uses container lifecycle hooks to restore and export the job filesystem, so it needs no shared volume

To customize further, leave containerMode empty and write the pod spec directly under template. The criteria below come from each mode’s requirements.

dind fits when:

  • Workflows call docker build or docker run directly
  • The cluster can allow privileged containers
  • You do not want to provision persistent volumes

The kubernetes modes fit when:

  • Privileged containers are not allowed
  • Jobs declare their environment with container:
  • Persistent volumes can be provisioned dynamically (kubernetes), or there is no shared storage (kubernetes-novolume)

The kubernetes modes reject jobs without container: by default. Setting ACTIONS_RUNNER_REQUIRE_JOB_CONTAINER to false allows them, but the GitHub docs warn that the runner pod may then gain Kubernetes API permissions such as creating pods and reading secrets.

Operational Issues

Sorting the issues in GitHub’s ARC troubleshooting guide by lifecycle phase narrows down what to check.

Install: name length errors. ARC uses generated resource names as labels on other resources, so it limits names to 63 characters. As a result, the installation name can be at most 45 characters and the namespace at most 63.

Setup: the listener pod never starts. Check the controller logs first. If they are clean, confirm that the controller can reach the Kubernetes API server. With an auto-injected sidecar proxy such as Istio, check that it allows traffic from the controller to the API server. If the listener pod is never created, suspect githubConfigSecret and githubConfigUrl first.

Scale-up: outdated runner images stop receiving jobs. On GitHub.com, if a runner is not updated within 63 days of a new runner version being released, the Actions Service stops sending it jobs. I expect this to catch teams that build custom runner images.

Canceled runs: extra runner pods appear briefly. The cancellation reaches the runners first; the listener only sees it on its next poll. If runner pods terminate in between, the listener creates new ones to match its desired count, then scales back down once it receives the cancellation. The effect is temporary.

Summary

In runner scale set mode, a job reaches one runner pod over two connections and is deleted with it. The listener receives the signal and changes replicas; the runner fetches the job and runs it. Unlike legacy mode, it scales on messages instead of API polling and registers runners with a JIT token instead of ARC’s credentials. Privileged-pod policy and available storage decide the containerMode.

References