Actions Runner Controller
set github runners on k8s cluster
Repository for better understanding - https://github.com/actions/actions-runner-controller
Using Helm, deploy the GitHub Actions Runner Controller (ARC) on Kubernetes. Set up and operate a workflow in the Kubernetes environment using runner scale settings to optimize parallel job execution and improve workflow speed.
Steps -
install k8's by kubespray
iptables -t nat -A POSTROUTING -s 172.17.0.0/16 -j MASQUERADE
apt-get -y install build-essential nghttp2 libnghttp2-dev libssl-dev
helm repo add actions-runner-controller https://actions-runner-controller.github.io/actions-runner-controller
helm repo update
kubectl create ns actions
kubectl create secret generic controller-manager -n actions --from-literal=github_token=<< github_token>>
helm repo add jetstack https://charts.jetstack.io
kubectl label namespace cert-manager certmanager.k8s.io/disable-validation=true
kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.15.0/cert-manager.crds.yaml
helm install runner actions-runner-controller/actions-runner-controller --namespace actions --version 0.20.2 --set syncPeriod=1m
kubectl apply -f runner_dockerbuild.yaml --validate=false
Create runner_dockerbuild.yaml file -
---
apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
name: k8s-single-runner
namespace: actions
spec:
# replicas: 5
template:
spec:
organization: 0chain
labels:
- build
- docker-builds
- arc-runner
- arc-runner3
# ephemeral: false
---
apiVersion: actions.summerwind.dev/v1alpha1
kind: HorizontalRunnerAutoscaler
metadata:
name: k8s-single-runner
namespace: actions
spec:
# Runners in the targeted RunnerDeployment won't be scaled down
# for 5 minutes instead of the default 10 minutes now
scaleDownDelaySecondsAfterScaleOut: 300
scaleTargetRef:
type: RunnerDeployment
# # In case the scale target is RunnerSet:
# kind: RunnerSet
name: k8s-single-runner
minReplicas: 2
maxReplicas: 4
metrics:
- type: PercentageRunnersBusy
scaleUpThreshold: '0.75'
scaleDownThreshold: '0.25'
scaleUpFactor: '2'
scaleDownFactor: '0.5'
Last updated