Fix in-cluster runner startup and readiness probes

Wait for DinD before starting forgejo-runner daemon; use TCP/_ping
probes so the Deployment reports available once both containers are up.
This commit is contained in:
tegwick 2026-07-03 22:32:34 +02:00
parent 0f0b340754
commit 28cbd3187c

View file

@ -101,9 +101,9 @@ spec:
- tcp://0.0.0.0:2375 - tcp://0.0.0.0:2375
- --tls=false - --tls=false
readinessProbe: readinessProbe:
exec: tcpSocket:
command: [docker, info] port: 2375
initialDelaySeconds: 5 initialDelaySeconds: 10
periodSeconds: 10 periodSeconds: 10
- name: runner - name: runner
image: code.forgejo.org/forgejo/runner:6.3.1 image: code.forgejo.org/forgejo/runner:6.3.1
@ -111,18 +111,26 @@ spec:
env: env:
- name: DOCKER_HOST - name: DOCKER_HOST
value: tcp://127.0.0.1:2375 value: tcp://127.0.0.1:2375
command: command: ["/bin/sh", "-c"]
- forgejo-runner args:
- daemon - |
- --config set -eu
- /data/config.yaml echo "waiting for DinD..."
for i in $(seq 1 90); do
if wget -q -O- http://127.0.0.1:2375/_ping 2>/dev/null | grep -q OK; then
echo "DinD ready"
break
fi
sleep 2
done
exec forgejo-runner daemon --config /data/config.yaml
volumeMounts: volumeMounts:
- name: data - name: data
mountPath: /data mountPath: /data
readinessProbe: readinessProbe:
exec: exec:
command: [forgejo-runner, -v] command: ["/bin/sh", "-c", "wget -q -O- http://127.0.0.1:2375/_ping | grep -q OK"]
initialDelaySeconds: 10 initialDelaySeconds: 15
periodSeconds: 30 periodSeconds: 30
volumes: volumes:
- name: data - name: data