From aad5264e9c23e576660617a7316337bcbcdcda81 Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Fri, 27 Nov 2026 06:54:08 +1100 Subject: [PATCH] Add iuclabs-dind ARC runner scale set with docker:dind sidecar --- .../iuclabs-dind/kustomization.yaml | 7 + .../iuclabs-dind/networkpolicy.yaml | 45 +++++ .../components/iuclabs-dind/scaleset.yaml | 161 ++++++++++++++++++ apps/base/iuclabs-runners/kustomization.yaml | 1 + 4 files changed, 214 insertions(+) create mode 100644 apps/base/iuclabs-runners/components/iuclabs-dind/kustomization.yaml create mode 100644 apps/base/iuclabs-runners/components/iuclabs-dind/networkpolicy.yaml create mode 100644 apps/base/iuclabs-runners/components/iuclabs-dind/scaleset.yaml diff --git a/apps/base/iuclabs-runners/components/iuclabs-dind/kustomization.yaml b/apps/base/iuclabs-runners/components/iuclabs-dind/kustomization.yaml new file mode 100644 index 0000000..3650eda --- /dev/null +++ b/apps/base/iuclabs-runners/components/iuclabs-dind/kustomization.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +resources: + - scaleset.yaml + - networkpolicy.yaml diff --git a/apps/base/iuclabs-runners/components/iuclabs-dind/networkpolicy.yaml b/apps/base/iuclabs-runners/components/iuclabs-dind/networkpolicy.yaml new file mode 100644 index 0000000..0e2ad38 --- /dev/null +++ b/apps/base/iuclabs-runners/components/iuclabs-dind/networkpolicy.yaml @@ -0,0 +1,45 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: egress-iuclabs-dind + namespace: iuclabs-runners +spec: + podSelector: + matchLabels: + runners.unkin.net/scale-set: iuclabs-dind + policyTypes: + - Egress + egress: + - to: + - ipBlock: + cidr: 0.0.0.0/0 + except: + - 10.0.0.0/8 + - 172.16.0.0/12 + - 192.168.0.0/16 + - 198.18.0.0/15 + - 0.0.0.0/8 + - 100.64.0.0/10 + - 127.0.0.0/8 + - 169.254.0.0/16 + - 224.0.0.0/4 + - 240.0.0.0/4 + ports: + - protocol: TCP + port: 443 + # vault.service.consul servers, from `dig vault.service.consul` + - to: + - ipBlock: + cidr: 198.18.25.78/32 + - ipBlock: + cidr: 198.18.26.197/32 + - ipBlock: + cidr: 198.18.27.116/32 + - ipBlock: + cidr: 198.18.28.248/32 + - ipBlock: + cidr: 198.18.29.92/32 + ports: + - protocol: TCP + port: 8200 diff --git a/apps/base/iuclabs-runners/components/iuclabs-dind/scaleset.yaml b/apps/base/iuclabs-runners/components/iuclabs-dind/scaleset.yaml new file mode 100644 index 0000000..fd3814b --- /dev/null +++ b/apps/base/iuclabs-runners/components/iuclabs-dind/scaleset.yaml @@ -0,0 +1,161 @@ +--- +apiVersion: actions.github.com/v1alpha1 +kind: AutoscalingRunnerSet +metadata: + name: iuclabs-dind + namespace: iuclabs-runners + labels: + app.kubernetes.io/version: "0.15.1" + annotations: + actions.github.com/cleanup-manager-role-name: arc-manager + actions.github.com/cleanup-manager-role-binding: arc-manager +spec: + githubConfigUrl: https://github.com/IUCLabs + githubConfigSecret: github-app + runnerScaleSetName: iuclabs-dind + minRunners: 0 + maxRunners: 4 + template: + metadata: + labels: + runners.unkin.net/scale-set: iuclabs-dind + spec: + serviceAccountName: runner + automountServiceAccountToken: false + restartPolicy: Never + securityContext: + runAsNonRoot: true + runAsUser: 1001 + runAsGroup: 1001 + supplementalGroups: + - 123 + seccompProfile: + type: RuntimeDefault + nodeSelector: + unkin.net/runner-pool: dind + tolerations: + - key: unkin.net/runner-pool + operator: Equal + value: dind + effect: NoSchedule + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: kubernetes.io/hostname + whenUnsatisfiable: ScheduleAnyway + labelSelector: + matchLabels: + runners.unkin.net/scale-set: iuclabs-dind + initContainers: + - name: init-dind-externals + image: ghcr.io/actions/actions-runner:2.338.2 + command: ["cp"] + args: ["-r", "/home/runner/externals/.", "/home/runner/tmpDir/"] + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + resources: + requests: + cpu: 100m + memory: 64Mi + limits: + cpu: 500m + memory: 256Mi + volumeMounts: + - name: dind-externals + mountPath: /home/runner/tmpDir + - name: dind + image: docker:29.9.3-dind + args: + - dockerd + - --host=unix:///var/run/docker.sock + - --group=$(DOCKER_GROUP_GID) + env: + - name: DOCKER_GROUP_GID + value: "123" + restartPolicy: Always + startupProbe: + exec: + command: + - docker + - info + initialDelaySeconds: 0 + failureThreshold: 24 + periodSeconds: 5 + securityContext: + privileged: true + runAsNonRoot: false + runAsUser: 0 + runAsGroup: 0 + resources: + requests: + cpu: 1 + memory: 1Gi + limits: + cpu: 2 + memory: 4Gi + volumeMounts: + - name: work + mountPath: /home/runner/_work + - name: dind-sock + mountPath: /var/run + - name: dind-externals + mountPath: /home/runner/externals + - name: dind-storage + mountPath: /var/lib/docker + containers: + - name: runner + image: ghcr.io/actions/actions-runner:2.338.2 + command: ["/home/runner/run.sh"] + env: + - name: ACTIONS_RUNNER_HOOK_JOB_STARTED + value: /hooks/job-started.sh + - name: NODE_EXTRA_CA_CERTS + value: /etc/vault-ca/ca.crt + - name: RUNNER_MODE + value: default + - name: DOCKER_HOST + value: unix:///var/run/docker.sock + - name: RUNNER_WAIT_FOR_DOCKER_IN_SECONDS + value: "120" + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + resources: + requests: + cpu: 1 + memory: 512Mi + limits: + cpu: 2 + memory: 2Gi + volumeMounts: + - name: work + mountPath: /home/runner/_work + - name: dind-sock + mountPath: /var/run + - name: hooks + mountPath: /hooks + readOnly: true + - name: vault-ca-cert + mountPath: /etc/vault-ca + readOnly: true + volumes: + - name: work + emptyDir: {} + - name: dind-sock + emptyDir: {} + - name: dind-externals + emptyDir: {} + - name: dind-storage + emptyDir: + sizeLimit: 30Gi + - name: hooks + configMap: + name: runner-hooks + defaultMode: 0555 + - name: vault-ca-cert + secret: + secretName: vault-ca-cert diff --git a/apps/base/iuclabs-runners/kustomization.yaml b/apps/base/iuclabs-runners/kustomization.yaml index 6f54792..02c4d76 100644 --- a/apps/base/iuclabs-runners/kustomization.yaml +++ b/apps/base/iuclabs-runners/kustomization.yaml @@ -13,6 +13,7 @@ components: - components/iuclabs-k8s - components/iuclabs-infra - components/iuclabs-release + - components/iuclabs-dind generatorOptions: disableNameSuffixHash: true