apps/forgejo/resources/runners/act-runner.yaml

86 lines
2.4 KiB
YAML
Raw Normal View History

2023-11-14 21:12:33 +00:00
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: act-runner-arm64
spec:
selector:
matchLabels:
app.kubernetes.io/name: act-runner
serviceName: act-runner
replicas: 2
template:
metadata:
labels:
app.kubernetes.io/name: act-runner
spec:
restartPolicy: Always
initContainers:
- name: runner-registration
image: docker.io/alpine:3.18
command:
- /bin/ash
- -c
- "cp /etc/act/`hostname` /data/.runner"
volumeMounts:
- name: runner-data
mountPath: /data
- name: runner-registrations
mountPath: /etc/act
containers:
- name: runner
image: act_runner
imagePullPolicy: Always
2023-11-17 07:18:15 +00:00
command: ["sh", "-c", "while ! nc -z localhost 2376 </dev/null; do echo 'waiting for docker daemon...'; sleep 5; done; /sbin/tini -- /opt/act/run.sh"]
2023-11-14 21:12:33 +00:00
env:
- name: DOCKER_HOST
value: tcp://localhost:2376
- name: DOCKER_CERT_PATH
value: /certs/client
- name: DOCKER_TLS_VERIFY
value: "1"
2023-11-17 07:18:15 +00:00
- name: CONFIG_FILE
value: /etc/act/config.yaml
2023-11-14 21:12:33 +00:00
volumeMounts:
2023-11-17 07:18:15 +00:00
- name: runner-data
mountPath: /data
- name: runner-config
mountPath: /etc/act
- name: docker-certs
mountPath: /certs
2023-11-14 21:12:33 +00:00
securityContext:
privileged: true
2023-11-17 07:18:15 +00:00
- name: daemon
image: docker:23.0.6-dind
env:
- name: DOCKER_TLS_CERTDIR
value: /certs
securityContext:
privileged: true
volumeMounts:
- name: docker-certs
mountPath: /certs
2023-11-14 21:12:33 +00:00
securityContext:
fsGroup: 1000
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- arm64
volumes:
- name: runner-data
emptyDir:
sizeLimit: 500Mi
2023-11-17 07:18:15 +00:00
- name: docker-certs
emptyDir:
sizeLimit: 5Mi
- name: runner-config
configMap:
name: act-runner-config
2023-11-14 21:12:33 +00:00
- name: runner-registrations
secret:
secretName: runner-registrations