|
| 1 | +# GitHub Actions Runner Setup |
| 2 | + |
| 3 | +This setup guide follows the GitHub Docs on |
| 4 | +[GitHub Actions / Self-hosted runners / Actions Runner Controller / Quickstart](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/quickstart-for-actions-runner-controller). |
| 5 | + |
| 6 | +Firstly, we install the Actions Runner Controller in namespace `arc-owntube-systems`: |
| 7 | + |
| 8 | +```bash |
| 9 | +export CONTROLLER_NAMESPACE=arc-owntube-systems |
| 10 | +microk8s helm3 install arc \ |
| 11 | + --namespace "${CONTROLLER_NAMESPACE}" \ |
| 12 | + --create-namespace \ |
| 13 | + oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller |
| 14 | +``` |
| 15 | + |
| 16 | +And then, we need to set up authentication as a GitHub App owned by the OwnTube.tv organisation per the |
| 17 | +[Authenticating ARC with a GitHub App](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/authenticating-to-the-github-api#authenticating-arc-with-a-github-app) |
| 18 | +documentation. |
| 19 | + |
| 20 | +```bash |
| 21 | +export APP_ID=996240 |
| 22 | +# from https://github.com/organizations/OwnTube-tv/settings/installations/54793885 |
| 23 | +export INSTALLATION_ID=54793885 |
| 24 | +export APP_PRIVATE_KEY="$(cat arc-owntube-runner.2024-09-12.private-key.pem)" |
| 25 | +export RUNNER_NAMESPACE=arc-owntube-runner |
| 26 | +microk8s kubectl create namespace $RUNNER_NAMESPACE |
| 27 | +microk8s kubectl create secret generic pre-defined-secret \ |
| 28 | + --namespace=$RUNNER_NAMESPACE \ |
| 29 | + --from-literal=github_app_id=$APP_ID \ |
| 30 | + --from-literal=github_app_installation_id=$INSTALLATION_ID \ |
| 31 | + --from-literal=github_app_private_key="$APP_PRIVATE_KEY" |
| 32 | +``` |
| 33 | + |
| 34 | +Now, configure a runner scale set: |
| 35 | + |
| 36 | +```bash |
| 37 | +export INSTALLATION_NAME="arc-owntube-runner" |
| 38 | +export RUNNER_NAMESPACE=arc-owntube-runner |
| 39 | +export GITHUB_CONFIG_URL="https://github.com/OwnTube-tv" |
| 40 | +microk8s helm install "${INSTALLATION_NAME}" \ |
| 41 | + --namespace "${RUNNER_NAMESPACE}" \ |
| 42 | + --create-namespace \ |
| 43 | + --set githubConfigUrl="${GITHUB_CONFIG_URL}" \ |
| 44 | + --set githubConfigSecret=pre-defined-secret \ |
| 45 | + oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set |
| 46 | +``` |
| 47 | + |
| 48 | +Run the following command to check your installation: |
| 49 | + |
| 50 | +```bash |
| 51 | +microk8s helm list -A |
| 52 | +'NAME NAMESPACE ... STATUS CHART APP VERSION' |
| 53 | +'arc arc-owntube-systems ... deployed gha-runner-scale-set-controller-0.9.3 0.9.3 ' |
| 54 | +'arc-owntube-runner arc-owntube-runner ... deployed gha-runner-scale-set-0.9.3 0.9.3 ' |
| 55 | +``` |
| 56 | + |
| 57 | +Check the manager pod: |
| 58 | + |
| 59 | +```bash |
| 60 | +microk8s kubectl get pods -n arc-owntube-systems |
| 61 | +'NAME READY STATUS RESTARTS AGE ' |
| 62 | +'arc-gha-rs-controller-66c95d466b-wb5rt 1/1 Running 0 3h21m' |
| 63 | +'arc-owntube-runner-79d95874-listener 1/1 Running 0 4m7s ' |
| 64 | +``` |
| 65 | + |
| 66 | +Continue with the [Using runner scale sets](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/quickstart-for-actions-runner-controller#using-runner-scale-sets) |
| 67 | +verification steps from the GitHub Docs to ensure everything is set up correctly. |
| 68 | + |
| 69 | +When jobs are picked up successfully by the controller, they appear as short-lived pods in |
| 70 | +the `arc-owntube-runner` namespace: |
| 71 | + |
| 72 | +```bash |
| 73 | +microk8s kubectl get pods -n arc-owntube-runner |
| 74 | +'NAME READY STATUS RESTARTS AGE' |
| 75 | +'arc-owntube-runner-zrcd7-runner-2dn2k 1/1 Running 0 32s' |
| 76 | +``` |
0 commit comments