Skip to content

GitHub Actions Runner Platform: Hosted Runners, VMSS, and ARC

Interactive Diagram

새 탭 ↗

Build execution environments should be selected with isolation, scalability, and image/network-access requirements considered together.

Build Server (GitHub Actions-based) Management

Section titled “Build Server (GitHub Actions-based) Management”

GitHub Actions is a CI/CD platform that lets you automate software development workflows directly in GitHub public or private repositories. Because it integrates directly with the GitHub repository, there’s no need for separate CI/CD tooling, and its YAML-based declarative pipeline definitions support a variety of trigger events, conditional execution, and matrix builds. It also supports custom execution environments via self-hosted runners, so a wide range of requirements can be handled on a single platform.

ItemDescription
WorkflowAn automated process defined in a YAML file, stored under the repository’s .github/workflows directory
EventA specific activity or rule that triggers a workflow (e.g. push, pull request, a scheduled time, etc.)
JobsA set of steps run on a runner. Can run in parallel or with dependencies between them
StepsIndividual commands or actions that perform a task
ActionsReusable units for tasks that recur frequently in a workflow
RunnersServers that execute workflow jobs. Can be GitHub-hosted runners or self-hosted runners

Workflow flow diagram

GitHub-Hosted Runner vs Self-Hosted Runner

Section titled “GitHub-Hosted Runner vs Self-Hosted Runner”

We split usage so that workflows needing free connectivity to public services use GitHub-hosted runners, while workflows that only need to communicate within the Azure private network (like the Terraform infra pipeline or GitOps) use self-hosted runners.

GitHub-hosted RunnerSelf-hosted Runner (VMSS or AKS-based)
MaintenanceMaintained and managed by GitHub, no need to manage build toolsRunner environment can be customized, and you can respond directly when issues occur
PerformancePerformance auto-tuned by GitHub, kept on the latest hardwareCan scale out via Azure VMSS/AKS as needed, but unlike a SaaS load, this incurs maintenance cost
CostLimited free usage hours, spending limits can be configuredAzure infra usage fees apply, but monitoring is transparent
SecurityGitHub security updates managed automatically, internal security requirements can’t be appliedInfra can be tailored to security requirements, but security policy must be managed in-house

Additional considerations: self-hosted runners are advantageous where compliance matters, and are essential if you need special hardware like GPUs. Conversely, GitHub-hosted runners have a lower learning curve. A hybrid approach (GitHub-hosted for general tasks, self-hosted for specialized ones) is quite practical too.

Self-hosted runners are broadly built either as VMSS (Runner Service) or as AKS-based Actions Runner Controller (ARC).

VMSS vs AKS

VMSS (Runner Service): authenticates via a GitHub Actions registration token and runs the runner process as a service daemon on a VMSS instance. It requires either standardizing on a golden image per runtime, or automating with a tool like Ansible.

AKS (Actions Runner Controller): authenticates via a GitHub Actions registration token to run a listener pod on the K8s cluster, which spins up a runner pod whenever an action runs. This can be standardized per runtime using a container image built from a Dockerfile, and has a lot of upside when you want to manage all your self-hosted runners in one unified cluster.

Differences when supporting multiple organizations

Section titled “Differences when supporting multiple organizations”

Runners are registered per GitHub organization (or repository), so the two approaches look very different once you support several organizations.

PlantUML Diagram
  • VMSS: each organization needs its own runner service. Organizations with the same runtime can share an instance, but stacking several runner services on one instance means managing disk and tool-version conflicts together. Splitting VMs per organization is simpler. The scaling unit is the VM, so more load means more VMs.
PlantUML Diagram
  • ARC: each organization needs one listener pod. The listener watches the job queue, and when a job arrives the controller creates a runner pod for that organization. Splitting runner pods by namespace separates permissions and resources between organizations, and keeping a work directory or cache requires a separate volume design.
CharacteristicSelf-Hosted Runner VMSSAKS (Actions Runner Controller)
ScalabilitySupports auto-scaling, at VM granularityMore fine-grained scaling, at pod granularity
Resource efficiencyAllocated at VM granularity, can be less efficientContainer-based, more optimized resource use
Setup complexityRelatively simpleRequires Kubernetes knowledge, more complex initial setup
MaintenanceRequires managing VM patches/updatesSimpler, just update the container image
Integration with existing infraLimited integrationIntegrates easily with existing Kubernetes infra
CostIdle VMs still cost moneyPods created only for jobs; node resources shared
IsolationStrong VM-level isolationContainer-level isolation; privileged work such as Docker builds needs separate design
NetworkSimple, just VM subnet designMust also account for cluster networking and NetworkPolicy

Since we had already built out an AKS-based GitOps environment for this project, we chose AKS-based ARC for the sake of unified operations, managing runners for multiple organizations from a single cluster.

Setting Up a Self-Hosted Runner with GitHub ARC

Section titled “Setting Up a Self-Hosted Runner with GitHub ARC”

ARC provides several resources and features needed to manage and scale GitHub Actions self-hosted runners on a Kubernetes cluster, and can be installed via a Helm chart. The two core CRDs are:

  • Autoscaling Runner: automatically adjusts the number of runners, creating/deleting runners based on traffic and workflow task volume. Configured via the AutoscalingRunnerSet resource, specifying min/max runner counts and scaling conditions.
apiVersion: actions.github.com/v1alpha1
kind: AutoscalingRunnerSet
metadata:
name: autoscaling-runner
namespace: arc-runners
spec:
githubConfigUrl: https://github.com/your-org/your-repo
githubConfigSecret: arc-github-secret # name of the Secret holding the GitHub App or PAT (string)
runnerScaleSetName: arc-runner-set # the name used in workflow runs-on
minRunners: 1
maxRunners: 10
template: # PodTemplateSpec (PodSpec under spec)
spec:
containers:
- name: runner
image: ghcr.io/actions/actions-runner:latest
command: ["/home/runner/run.sh"]
  • Ephemeral Runner: a temporary runner that’s automatically deleted once its job completes. Since it’s removed right after execution, it’s useful from both a security and resource-management standpoint.

You do not write this resource yourself. The controller creates and deletes one per job via AutoscalingRunnerSet → EphemeralRunnerSet. Check its state like this:

Terminal window
kubectl get autoscalingrunnersets,ephemeralrunnersets,ephemeralrunners -n arc-runners

The YAML above follows the gha-runner-scale-set 0.12.x CRD. In practice you install it through Helm chart values as shown below; check the values and CRD schema of the chart version you use.

We created an ARC and a GitHub Actions Runner Listener per GitHub organization to provide a stable build environment per organization.

AKS-based GitHub ARC configuration

Public GitHub Web UI view:

Helm-Chart-based Installation and Runner Deployment

Section titled “Helm-Chart-based Installation and Runner Deployment”
Terminal window
# Add the Helm chart
helm repo add actions-runner-controller https://actions-runner-controller.github.io/actions-runner-controller
# Install ARC
kubectl create namespace actions-runner-system
helm install --namespace actions-runner-system actions-runner-controller actions-runner-controller/actions-runner-controller
# Configure GitHub authentication
kubectl create secret generic controller-manager -n actions-runner-system --from-literal=github_token=<YOUR_PAT>
# Apply the runner
kubectl apply -f runner-deployment.yaml

Installing runner scale sets per GitHub org:

Terminal window
INSTALLATION_NAME="arc-runner-set"
NAMESPACE="arc-runners"
GITHUB_CONFIG_URL="<https://github.com/<your_enterprise/org/repo>>"
GITHUB_PAT="<PAT>"
helm install "${INSTALLATION_NAME}" \
--namespace "${NAMESPACE}" \
--create-namespace \
--set githubConfigUrl="${GITHUB_CONFIG_URL}" \
--set githubConfigSecret.github_token="${GITHUB_PAT}" \
oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set

Checking ARC status:

kubectl get all -n arc-system
# current status
NAME READY STATUS RESTARTS AGE
pod/arc-gha-rs-controller-5d5ccf54f5-dnsvd 1/1 Running 0 15h
pod/arc-runner-org-dev-67d9c88b-listener 1/1 Running 0 3h7m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/arc-gha-rs-controller 1/1 1 1 2d23h
NAME DESIRED CURRENT READY AGE
replicaset.apps/arc-gha-rs-controller-5d5ccf54f5 1 1 1 2d23h

In a workflow, you can select a self-hosted runner via a runner-options label:

on:
workflow_dispatch:
inputs:
runner:
required: true
type: choice
options:
- ubuntu-latest # GitHub-hosted runner
- arc-runner-org-dev # Self-hosted runner
environment:
description: "Deployment environment"
required: true
default: "dev"
type: choice
options:
- dev
- prd
jobs:
build:
name: (${{ inputs.environment }}) Build using maven
runs-on: "${{ inputs.runner }}" # runs on whichever runner was selected

This article covered the selection and setup of hosted and self-hosted runners, VMSS, and ARC. Next, deliver build results through Argo CD GitOps.

Previous: Git and Release Governance: Branches, Versions, and Image Tags
Next: GitOps Delivery with Argo CD: Components, Objects, and Utility Deployment