From c033cc3ff8121e6f74bb541d17aa737a5dc3399d Mon Sep 17 00:00:00 2001 From: ZhenYi <434836402@qq.com> Date: Wed, 15 Apr 2026 22:13:16 +0800 Subject: [PATCH] fix(k8s): add procps to worker images and fix probe commands - Add procps to git-hook and email-worker Dockerfiles (provides pgrep) - Change all exec probes from pgrep to kill -0 1 (more reliable, bash built-in) - Add startupProbe to gitserver with 30 failure threshold (5min max startup time) - Increase gitserver liveness initialDelay to 30s for slower SSH init --- deploy/values.yaml | 19 +++++++++++++------ docker/email-worker.Dockerfile | 2 +- docker/git-hook.Dockerfile | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/deploy/values.yaml b/deploy/values.yaml index fba5f94..110dda7 100644 --- a/deploy/values.yaml +++ b/deploy/values.yaml @@ -281,7 +281,7 @@ gitserver: livenessProbe: tcpSocket: port: 8022 - initialDelaySeconds: 10 + initialDelaySeconds: 30 periodSeconds: 15 timeoutSeconds: 5 failureThreshold: 3 @@ -289,11 +289,18 @@ gitserver: readinessProbe: tcpSocket: port: 8022 - initialDelaySeconds: 5 + initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 3 failureThreshold: 3 + startupProbe: + tcpSocket: + port: 8022 + initialDelaySeconds: 0 + periodSeconds: 10 + failureThreshold: 30 + persistence: enabled: true storageClass: "" @@ -324,7 +331,7 @@ emailWorker: command: - /bin/sh - -c - - "pgrep email-worker || exit 1" + - "kill -0 1 || exit 1" initialDelaySeconds: 10 periodSeconds: 30 timeoutSeconds: 5 @@ -335,7 +342,7 @@ emailWorker: command: - /bin/sh - -c - - "pgrep email-worker || exit 1" + - "kill -0 1 || exit 1" initialDelaySeconds: 5 periodSeconds: 15 timeoutSeconds: 3 @@ -373,7 +380,7 @@ gitHook: command: - /bin/sh - -c - - "pgrep git-hook || exit 1" + - "kill -0 1 || exit 1" initialDelaySeconds: 10 periodSeconds: 15 timeoutSeconds: 5 @@ -384,7 +391,7 @@ gitHook: command: - /bin/sh - -c - - "pgrep git-hook || exit 1" + - "kill -0 1 || exit 1" initialDelaySeconds: 5 periodSeconds: 10 timeoutSeconds: 3 diff --git a/docker/email-worker.Dockerfile b/docker/email-worker.Dockerfile index dfcec89..b9d2bbc 100644 --- a/docker/email-worker.Dockerfile +++ b/docker/email-worker.Dockerfile @@ -2,7 +2,7 @@ FROM debian:bookworm-slim RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates libssl3 \ + ca-certificates libssl3 procps \ && rm -rf /var/lib/apt/lists/* WORKDIR /app diff --git a/docker/git-hook.Dockerfile b/docker/git-hook.Dockerfile index 3ae23b3..ddd2d23 100644 --- a/docker/git-hook.Dockerfile +++ b/docker/git-hook.Dockerfile @@ -2,7 +2,7 @@ FROM debian:bookworm-slim RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates libssl3 openssh-client \ + ca-certificates libssl3 openssh-client procps \ && rm -rf /var/lib/apt/lists/* WORKDIR /app