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

101 lines
3.2 KiB
YAML
Raw Normal View History

2023-11-14 21:12:33 +00:00
---
apiVersion: apps/v1
2024-02-22 15:06:41 +00:00
kind: Deployment
2023-11-14 21:12:33 +00:00
metadata:
2023-11-30 07:52:03 +00:00
name: act-runner-amd64
2023-11-14 21:12:33 +00:00
spec:
selector:
matchLabels:
app.kubernetes.io/name: act-runner
2023-11-30 07:52:03 +00:00
app.kubernetes.io/instance: amd64
replicas: 1
2023-11-14 21:12:33 +00:00
template:
metadata:
labels:
app.kubernetes.io/name: act-runner
2023-11-30 07:52:03 +00:00
app.kubernetes.io/instance: amd64
2023-11-14 21:12:33 +00:00
spec:
restartPolicy: Always
2024-02-22 15:06:41 +00:00
# Initialise our configuration file using offline registration
# https://forgejo.org/docs/v1.21/admin/actions/#offline-registration
2023-11-14 21:12:33 +00:00
initContainers:
2024-02-22 15:06:41 +00:00
- name: runner-register
image: act_runner
command: ["forgejo-runner"]
args:
- "register"
- "--no-interactive"
- "--token"
- $(RUNNER_SECRET)
- "--name"
- $(RUNNER_NAME)
- "--instance"
- $(FORGEJO_INSTANCE_URL)
- "--labels"
- "docker:docker://code.icb4dc0.de/infrastructure/images/act_runtime:amd64,ubuntu-latest-amd64:docker://code.icb4dc0.de/infrastructure/images/act_runtime:amd64,ubuntu-22.04-amd64:docker://code.icb4dc0.de/infrastructure/images/act_runtime:amd64,ubuntu-20.04-amd64:docker://code.icb4dc0.de/infrastructure/images/act_runtime:20.04-amd64"
env:
- name: RUNNER_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: RUNNER_SECRET
valueFrom:
secretKeyRef:
name: forgejo-runner-secret
key: token
- name: FORGEJO_INSTANCE_URL
value: http://forgejo-http.forgejo.svc.cluster.local:3000
resources:
limits:
cpu: "0.50"
memory: "64Mi"
2023-11-14 21:12:33 +00:00
volumeMounts:
2024-02-22 15:06:41 +00:00
- name: runner-data
mountPath: /data
2023-11-14 21:12:33 +00:00
containers:
- name: runner
image: act_runner
imagePullPolicy: Always
2024-02-22 15:06:41 +00:00
command: ["sh", "-c", "while ! nc -z localhost 2376 </dev/null; do echo 'waiting for docker daemon...'; sleep 5; done; forgejo-runner daemon --config /etc/act/config.yaml"]
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"
volumeMounts:
2023-11-17 07:18:15 +00:00
- name: runner-data
mountPath: /data
- name: docker-certs
mountPath: /certs
2024-02-22 15:06:41 +00:00
- name: runner-config
mountPath: /etc/act
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
2024-02-22 15:06:41 +00:00
- name: runner-data
mountPath: /data
2023-11-14 21:12:33 +00:00
securityContext:
fsGroup: 1000
nodeSelector:
kubernetes.io/arch: amd64
2023-11-14 21:12:33 +00:00
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:
2024-02-22 15:06:41 +00:00
name: act-runner-config-amd64