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:
@@ -101,9 +101,9 @@ spec:
|
||||
- tcp://0.0.0.0:2375
|
||||
- --tls=false
|
||||
readinessProbe:
|
||||
exec:
|
||||
command: [docker, info]
|
||||
initialDelaySeconds: 5
|
||||
tcpSocket:
|
||||
port: 2375
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
- name: runner
|
||||
image: code.forgejo.org/forgejo/runner:6.3.1
|
||||
@@ -111,18 +111,26 @@ spec:
|
||||
env:
|
||||
- name: DOCKER_HOST
|
||||
value: tcp://127.0.0.1:2375
|
||||
command:
|
||||
- forgejo-runner
|
||||
- daemon
|
||||
- --config
|
||||
- /data/config.yaml
|
||||
command: ["/bin/sh", "-c"]
|
||||
args:
|
||||
- |
|
||||
set -eu
|
||||
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:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
readinessProbe:
|
||||
exec:
|
||||
command: [forgejo-runner, -v]
|
||||
initialDelaySeconds: 10
|
||||
command: ["/bin/sh", "-c", "wget -q -O- http://127.0.0.1:2375/_ping | grep -q OK"]
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 30
|
||||
volumes:
|
||||
- name: data
|
||||
|
||||
Reference in New Issue
Block a user