Kubernetes provides liveness, readiness, and startup probes to ensure container health and resilience, preventing silent pod failures and unnecessary restarts.
Liveness probes restart containers if they detect non-responsiveness, like in deadlocks, while readiness probes prevent routing traffic to unready pods.
Startup probes in Kubernetes 1.16 delay liveness and readiness checks until startup is successful, avoiding premature container restarts.
Probes use mechanisms like HTTP GET, TCP socket, or commands to check health, with successful probes returning specific statuses.
Configuring probes in YAML includes parameters like initialDelaySeconds, periodSeconds, timeoutSeconds, failureThreshold, and successThreshold.
Best practices include using readiness for temporary unavailability, keeping probes simple, tuning timeouts to app behavior, and testing probes in staging.
Common pitfalls to avoid include misconfiguring probes, aligning probes with app logic, and monitoring probe behavior in production clusters.
Probes prevent issues like early traffic to unready pods, auto-recovering hung services, and cascading failures, but misconfiguration can lead to downtime.
Liveness probes should be used thoughtfully to avoid unnecessary restarts, especially in scenarios where the risk of misprobes outweighs the benefits.
Overall, probes are essential for automation and self-healing in Kubernetes, and proper configuration is key to building resilient containerized applications.
Understanding application behavior and tuning probe parameters accordingly ensures that probes effectively monitor container health and prevent common production issues.