This repository contains Helm charts and configurations for deploying the official Microsoft-supported GitHub Actions Runner Controller to Azure Kubernetes Service (AKS) with support for multiple runner scale sets using different runner images.
Note: This repository uses the official Microsoft-supported GitHub Actions Runner Controller from actions/actions-runner-controller, not the community-maintained version.
The GitHub Actions Runner Controller allows you to automatically scale GitHub Actions runners in Kubernetes. This setup provides:
- Main Controller: Manages the core runner controller infrastructure
- Standard Runners: Default runner scale set with standard runner image
- Custom Runners: Additional scale sets with different runner images for specific workloads
┌─────────────────────────────────────────────────────────────┐
│ AKS Cluster │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────────┐ ┌─────────────────┐ ┌──────────────┐ │
│ │ Runner Controller│ │ Standard Runners│ │ Custom Runners│ │
│ │ │ │ Scale Set │ │ Scale Sets │ │
│ │ - Manager │ │ - Default Image │ │ - Custom Imgs │ │
│ │ - Webhook │ │ - Auto-scaling │ │ - Specialized │ │
│ │ - Metrics │ │ - Workloads │ │ - Workloads │ │
│ └─────────────────┘ └─────────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
- Azure CLI
- kubectl
- Helm 3.x
- AKS cluster with appropriate permissions
- GitHub Personal Access Token with
repoandadmin:orgscopes - Azure managed identity with appropriate permissions for AKS and ACR access
-
Clone and setup:
git clone <repository-url> cd github-arc
-
Configure your environment:
# Edit config/values.yaml with your configuration # Note: GitHub token and webhook secret are handled via environment variables # Set GITHUB_TOKEN and GITHUB_WEBHOOK_SECRET environment variables before deployment
-
Deploy the controller:
helm install github-runner-controller ./charts/controller \ -f config/values.yaml \ --namespace github-runner-system \ --create-namespace
-
Deploy standard runners:
helm install standard-runners ./charts/runner-set \ -f config/values.yaml \ -f config/standard-runners.yaml \ --namespace github-runner-system
-
Deploy custom runners (optional):
helm install custom-runners ./charts/runner-set \ -f config/values.yaml \ -f config/custom-runners.yaml \ --namespace github-runner-system
-
Set up required secrets in your GitHub repository:
AZURE_CLIENT_ID: Azure managed identity client IDAZURE_TENANT_ID: Azure tenant IDAZURE_SUBSCRIPTION_ID: Azure subscription IDAKS_RESOURCE_GROUP: AKS resource group nameAKS_CLUSTER_NAME: AKS cluster nameACR_NAME: Azure Container Registry name (without .azurecr.io)GITHUB_TOKEN: GitHub Personal Access Token withrepoandadmin:orgscopesGITHUB_WEBHOOK_SECRET: GitHub webhook secret for secure webhook communication
-
Deploy using workflows:
- Go to Actions tab
- Run "Deploy GitHub Actions Runner Controller" workflow
- Run "Deploy Runner Scale Sets" workflow
For detailed CI/CD setup instructions, see CI/CD Setup Guide.
To use managed identity authentication:
-
Create a managed identity (if not already exists):
az identity create --name github-runner-identity --resource-group your-resource-group
-
Assign permissions to the managed identity:
# Get the managed identity client ID CLIENT_ID=$(az identity show --name github-runner-identity --resource-group your-resource-group --query clientId -o tsv) # Assign AKS permissions az role assignment create --assignee $CLIENT_ID --role "Azure Kubernetes Service Cluster Admin Role" --scope /subscriptions/your-subscription-id/resourceGroups/your-aks-resource-group/providers/Microsoft.ContainerService/managedClusters/your-aks-cluster # Assign ACR permissions az role assignment create --assignee $CLIENT_ID --role "AcrPush" --scope /subscriptions/your-subscription-id/resourceGroups/your-acr-resource-group/providers/Microsoft.ContainerRegistry/registries/your-acr-name
-
Configure GitHub Actions runner to use the managed identity:
- Ensure your GitHub Actions runner VM has the managed identity assigned
- The workflows will automatically use the managed identity for authentication
- GitHub authentication settings
- Controller configuration
- Default runner settings
- AKS-specific configurations
- Standard Runners (
config/standard-runners.yaml): Default runners for general workloads - Custom Runners (
config/custom-runners.yaml): Specialized runners with custom images
Access the controller dashboard:
kubectl port-forward -n github-runner-system svc/github-runner-controller 8080:80Then visit: http://localhost:8080
See TROUBLESHOOTING.md for common issues and solutions.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE for details.