1. What is Startup Probe?
π Startup probe = check if application has started successfully
- Runs only during startup (not continuous)
- Used for slow-starting apps (Java, Spring Boot, DB-heavy apps)
- Until it passes:
- β Liveness NOT executed
- β Readiness NOT executed
β This prevents Kubernetes from killing app too early.
2. Why we need Startup Probe (real problem)
Without startup probe:
- App takes 40 sec to start
- Liveness starts in 10 sec
π Kubernetes thinks app failed
π Restarts pod β CrashLoopBackOff
With startup probe:
- Kubernetes waits until app fully starts
- Then starts liveness & readiness
β Fixes unnecessary restarts
3. Three Main Differences (easy table)
| Feature | Startup Probe | Liveness Probe | Readiness Probe |
|---|---|---|---|
| Purpose | Check app started | Check app alive | Check app ready |
| Runs | Only at startup | Continuous | Continuous |
| On failure | Restart container | Restart container | Remove traffic |
| Special behavior | Disables other probes until success | Independent | Independent |
Simple Startup Probe Example (YAML)
apiVersion: v1kind: Podmetadata: name: startup-demospec: containers: - name: app image: nginx ports: - containerPort: 80 startupProbe: httpGet: path: / port: 80 initialDelaySeconds: 5 periodSeconds: 10 failureThreshold: 5
What happens:
- Kubernetes sends HTTP request
/ - If not ready β retry
- If fails many times β restart
- If success β β start liveness & readiness
Another Example (Exec type β real usage)
startupProbe: exec: command: - cat - /tmp/app-ready initialDelaySeconds: 3 periodSeconds: 5
Use case:
- App creates file
/tmp/app-readyafter startup - Until then β probe fails
- Once file exists β app marked started
Commands (same as other probes)
kubectl apply -f startup.yamlkubectl get podskubectl describe pod startup-demo
Real DevOps Example (important π₯)
Scenario β Spring Boot app
- Startup time: 60 sec
- Without startup probe β killed repeatedly
- With startup probe β works fine
β This is VERY common issue in EKS / production
Short Explain:
Startup β app started or not
Liveness β app alive or not
Readiness β ready for traffic or not