DevZero Logo
DevZero

GitHub Actions (DevZero Kubernetes)

Running Github Actions using a controller on DevZero Kubernetes clusters.

Pre-built recipe templates are available here.

Intended Audience

This page is for platform engineers looking to solve one or multiple of the following:

  • Growing costs related to GitHub Actions use (either GitHub-hosted, or self-hosted).
  • Challenges around supporting/maintaining self-hosted runners.
    • Managing the lifecycle of the runners (ensuring they're up-to-date)
    • Scaling runner groups predictably/proportionally with size of job queues
    • Supporting various shapes of runner pools/groups (by CPU, memory, preinstalled toolset etc.)
    • Cloud infrastructure costs of operating self-hosted runners
  • Visibility into individual workflows and jobs.
  • Challenges around operating GitHub's action-runner-controller in self-managed Kubernetes clusters (docker-in-docker, low-level infrastructure tooling, toolset complexity, etc).
  • Strong security isolation between concurrently running jobs on a given node.
  • Shortening test run durations when using GitHub-hosted runners.

Using DevZero's Actions Runner Controller

You can run GitHub actions on ephemeral runners on DevZero using the Actions Runner Controller (ARC). This guide will help you install ARC on DevZero for your organization.

For more background on ARC you can also review GitHub's docs.

You will need a Personal Access Token (PAT). There's a GitHub App-based workflow supported as well.

Create a PAT

Visit Profile > Developer Settings > Personal access tokens > Tokens (classic).

Click on "Generate new token". Then, select "Generate new token (classic)".

In the "scopes" section, select repo and optionally admin:org for organization runners.

Copy your new Personal Access Token and store it somewhere.

Set up the runners

Provision a new DevZero cluster (or use dz cluster create).

Install kubectl and helm in your terminal (or provision a new DevZero workspace with kubectl and helm installed).

Skip to the next step if you're in a workspace since kubeconfig is already set up.

To configure your kubectl to point to your DevZero cluster, download the kubeconfig for the DevZero cluster

dz cluster kubeconfig <cluster-id> -u

Verify access by running

kubectl get pods

Install Actions Runner Controller using helm.

Using the prebuilt chart:

helm upgrade arc \
  --install oci://ghcr.io/devzero-inc/actions-runner-charts/gha-runner-scale-set-controller

pass the flag --set githubEnterpriseServerURL=https://YOURENTERPRISEURL/ if you're using Github Enterprise Server

Install a runner scale-set using helm.

To verify the installation:

Pick a repository of your choice and cd into it

cd <my-favorite-repo>

Ensure that there's a directory for GitHub workflows.

mkdir -p .github/workflows

Create a test workflow file

touch .github/workflows/testing-devzero-runner.yml

Open the file and paste the following contents and then save it:

name: DevZero Actions Runner Controller Demo
on: [pull_request, push]
jobs:
  Explore-GitHub-Actions-Arc:
    runs-on: devzero-ubuntu-24.04
    steps:
      - run: echo "🎉 This job uses runner scale set runners!"
Since the helm release name is devzero-ubuntu-24.04, runs-on is set to devzero-ubuntu-24.04 (see previous section).

Create a new branch with your changes and push them.

git checkout -b devzero-github-actions-runner
git add .github/workflows/testing-devzero-runner.yml
git commit -m 'testing DevZero-hosted GitHub Action Runners'
git push origin devzero-github-actions-runner

Create the PR in the GitHub console and then see the workflow run.

Advanced configurations

Using a self-hosted runner

Check out this page.

On this page