doran/deploy/k8s/platform/base/forgejo-runner.yaml
2026-03-28 20:53:29 +01:00

47 lines
1.4 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: forgejo-runner
namespace: forgejo
spec:
replicas: 1
selector:
matchLabels:
app: forgejo-runner
template:
metadata:
labels:
app: forgejo-runner
spec:
serviceAccountName: forgejo-runner
restartPolicy: Always
containers:
- name: runner
image: code.forgejo.org/forgejo/runner:6.3.1
securityContext:
runAsUser: 0
runAsGroup: 0
env:
- name: FORGEJO_INSTANCE_URL
valueFrom:
secretKeyRef:
name: forgejo-secrets
key: root_url
- name: FORGEJO_RUNNER_REGISTRATION_TOKEN
valueFrom:
secretKeyRef:
name: forgejo-secrets
key: runner_registration_token
command: ["/bin/sh", "-lc"]
args:
- >-
if [ ! -f /data/.runner ]; then
forgejo-runner register --no-interactive --name k3s-runner --instance "$FORGEJO_INSTANCE_URL" --token "$FORGEJO_RUNNER_REGISTRATION_TOKEN" --labels "linux-amd64:host";
fi &&
forgejo-runner daemon --config /data/.runner
volumeMounts:
- name: runner-data
mountPath: /data
volumes:
- name: runner-data
emptyDir: {}