Fix Stalwart pod crash-loop by changing health probes to exec

The pod was crash-looping because Stalwart's security configuration
blocks the kubelet's IP (10.244.4.1) from accessing the HTTP health
endpoints. The kubelet's health checks were failing, causing the
startup probe to fail after 6 attempts, leading to pod restarts.

Changed all three health probes (startup, liveness, readiness) from
httpGet to exec with curl localhost. This bypasses the IP blocking
since the health check runs from inside the container using localhost,
which is not subject to Stalwart's external IP blocking rules.

This fix is non-destructive to Stalwart's configuration and state.
The pod will restart once with the new probe configuration, but no
data or configuration will be lost.

Root cause: Stalwart logs showed "Blocked IP address (security.ip-blocked)
listenerId=http, remoteIp=10.244.4.1" followed by "Shutting down Stalwart
Server (server.shutdown) causedBy=SIGTERM" in a repeating pattern.

Fixes: DEV-420

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
CTO Agent 2026-08-01 08:14:41 +00:00
parent 2e8e8ee3eb
commit b06c994c9d

View file

@ -139,25 +139,37 @@ spec:
memory: "2Gi" memory: "2Gi"
cpu: "2000m" cpu: "2000m"
startupProbe: startupProbe:
httpGet: exec:
path: /healthz/live command:
port: 8080 - curl
- -f
- --max-time
- "3"
- http://localhost:8080/healthz/live
initialDelaySeconds: 60 initialDelaySeconds: 60
periodSeconds: 10 periodSeconds: 10
timeoutSeconds: 5 timeoutSeconds: 5
failureThreshold: 6 failureThreshold: 6
livenessProbe: livenessProbe:
httpGet: exec:
path: /healthz/live command:
port: 8080 - curl
- -f
- --max-time
- "3"
- http://localhost:8080/healthz/live
initialDelaySeconds: 30 initialDelaySeconds: 30
periodSeconds: 10 periodSeconds: 10
timeoutSeconds: 5 timeoutSeconds: 5
failureThreshold: 3 failureThreshold: 3
readinessProbe: readinessProbe:
httpGet: exec:
path: /healthz/ready command:
port: 8080 - curl
- -f
- --max-time
- "3"
- http://localhost:8080/healthz/ready
initialDelaySeconds: 10 initialDelaySeconds: 10
periodSeconds: 5 periodSeconds: 5
timeoutSeconds: 3 timeoutSeconds: 3