-
Notifications
You must be signed in to change notification settings - Fork 90
73 lines (60 loc) · 2.69 KB
/
arm64-arc-runner-set.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Arm64 ARC Runner Set
on:
schedule:
- cron: "0 17 * * 0" # 5pm UTC on Sundays
workflow_dispatch: {}
jobs:
create-controller:
runs-on: ubuntu-latest
env:
CLUSTER_NAME: kots-arm64-arc
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install replicated CLI
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download --repo replicatedhq/replicated --pattern '*_linux_amd64.tar.gz' --output /tmp/replicated.tar.gz --clobber
tar -xzf /tmp/replicated.tar.gz -C /tmp
mv /tmp/replicated /usr/local/bin/replicated
- name: Remove existing CMX Cluster
run: replicated cluster rm --name "$CLUSTER_NAME" --token '${{ secrets.C11Y_MATRIX_TOKEN }}'
- name: Create new CMX Cluster
run: |
set -euo pipefail
replicated cluster create \
--token '${{ secrets.C11Y_MATRIX_TOKEN }}' \
--distribution eks \
--instance-type m7g.2xlarge \
--name "$CLUSTER_NAME" \
--ttl 168h \
--wait 120m
replicated cluster kubeconfig \
--token '${{ secrets.C11Y_MATRIX_TOKEN }}' \
--name "$CLUSTER_NAME"
# reference: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/quickstart-for-actions-runner-controller
- name: Setup Actions Runner Controller (ARC)
run: |
set -euo pipefail
helm install arc \
--namespace arc-systems \
--create-namespace \
--version 0.9.2 \
oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller
kubectl create namespace arc-runners
kubectl create secret generic github-config-secret \
--namespace=arc-runners \
--from-literal=github_token="${{ secrets.GH_PAT }}"
helm install arm64-runner-set \
--namespace arc-runners \
--set githubConfigUrl="https://github.com/replicatedhq/kots" \
--set githubConfigSecret="github-config-secret" \
--version 0.9.2 \
oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set
# bubblewrap (which is a sandbox tool used by melange) requires privileged docker containers.
# issue reference: https://github.com/containers/bubblewrap/issues/505
kubectl patch autoscalingrunnerset arm64-runner-set \
--namespace arc-runners \
--type json \
--patch '[{"op": "add", "path": "/spec/template/spec/containers/0/securityContext", "value": {"privileged": true}}]'