doran/deploy/k8s/platform/base/forgejo-runner.yaml

53 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
initContainers:
- name: wait-for-runner-config
image: busybox:1.36
command: ["/bin/sh", "-ec"]
args:
- >-
until [ -s /data/.runner ]; do
echo "waiting for bootstrap to write /data/.runner";
sleep 5;
done
volumeMounts:
- name: forgejo-data
mountPath: /data
subPath: forgejo-runner
containers:
- name: runner
image: code.forgejo.org/forgejo/runner:6.3.1
securityContext:
runAsUser: 0
runAsGroup: 0
env:
- name: FORGEJO_RUNNER_CONFIG
value: /data/.runner
command: ["/bin/sh", "-lc"]
args:
- >-
test -s "$FORGEJO_RUNNER_CONFIG" &&
forgejo-runner daemon --config "$FORGEJO_RUNNER_CONFIG"
volumeMounts:
- name: forgejo-data
mountPath: /data
subPath: forgejo-runner
volumes:
- name: forgejo-data
persistentVolumeClaim:
claimName: forgejo-data