Startup Probes for Slow-Starting Containers
What You'll Learn
You'll understand how startup probes give slow-initializing applications extra time to start without interfering with ongoing health monitoring.
The Problem Startup Probes Solve
Some applications—like legacy monoliths, JVM-based services, or data-heavy apps—can take minutes to initialize. If you configure a liveness probe to check health every 10 seconds, Kubernetes might kill and restart your container before it even finishes starting up. You could set a very long initialDelaySeconds on your liveness probe, but then you're delaying health checks for fast-starting containers too.
How Startup Probes Work
A startup probe runs before liveness and readiness probes activate. Think of it as a patient gatekeeper: it keeps checking "Are you done starting yet?" without the harsh consequences of a liveness failure. Once the startup probe succeeds once, it stops running and hands control to the liveness and readiness probes.
You can configure startup probes with generous retry counts. For example, checking every 10 seconds for up to 5 minutes (30 attempts × 10 seconds) gives your app plenty of runway:
startupProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 0
periodSeconds: 10
failureThreshold: 30 # 30 × 10s = 5 minutes max
During startup, liveness probes are disabled. This prevents premature restarts while your app is legitimately taking time to initialize databases, warm caches, or load configurations.
When to Use Startup Probes
Use startup probes when your application has unpredictable or lengthy initialization but you still want aggressive liveness checking once it's running. This combination protects slow starters while maintaining tight health monitoring post-startup.
Key Takeaway: Startup probes decouple initialization time from runtime health checks, protecting slow-starting containers from premature liveness probe failures while allowing aggressive monitoring once the application is ready.