Advertisement
Interview Question
What is the difference between readiness and liveness probes in Kubernetes?
Key Points to Cover
- Readiness gates traffic until pod is ready; failing removes from endpoints
- Liveness restarts the container when it gets unhealthy
- Probes: HTTP/TCP/exec with initialDelay, period, thresholds
Evaluation Rubric
Explains readiness behavior34% weight
Explains liveness restart semantics33% weight
Mentions probe types and tuning33% weight
Hints
- 💡A startup probe can protect slow apps from restarts.
Common Pitfalls to Avoid
- ⚠️**Misusing probes:** Using a liveness probe to check for application readiness, leading to continuous restarts when the application is merely warming up.
- ⚠️**Overly aggressive probe settings:** Setting `initialDelaySeconds` too low, or `periodSeconds` and `failureThreshold` too short, causing premature restarts or traffic removal for temporary issues.
- ⚠️**Probes not reflecting true application health:** Checking only basic HTTP status codes (e.g., 200 OK) when the application might be running but functionally broken (e.g., unable to connect to a critical backend service).
- ⚠️**Long-running Exec probes:** An `exec` command that takes too long to complete might exceed `timeoutSeconds` and be mistakenly considered a probe failure.
- ⚠️**Not using both probes:** Relying solely on liveness or readiness, missing out on the complementary benefits for robust fault tolerance, such as isolating non-ready pods while gracefully restarting truly unhealthy ones.
Potential Follow-up Questions
- ❓When to use startup probes?
- ❓Common pitfalls causing restart loops?
Advertisement
Related Questions
Questions that share similar topics with this one
Kubernetes Pod Stuck in Pending
Intermediate📞 Phone Screen•2 min•Phone
Kubernetes Pod Restart Loop Troubleshooting
Intermediate🔬 Technical Deep Dive•5 min•Technical
Investigating High CPU Usage in Kubernetes Pods
Advanced🔬 Technical Deep Dive•5 min•Technical
Kubernetes Pod Stuck in Pending
Intermediate🔧 Troubleshooting Scenarios•10 min•Scenario
Node Disk Full
Intermediate🔧 Troubleshooting Scenarios•10 min•Scenario