What if your app could fix itself before you even notice a problem?
Why Liveness probe concept in Kubernetes? - Purpose & Use Cases
Imagine you have a web app running on a server. Sometimes, it freezes or crashes silently without stopping the server. You have to check manually if it is still working by opening the app or looking at logs.
Manually checking if your app is alive is slow and tiring. You might miss the freeze and users get stuck. Restarting the app late means downtime and unhappy users. It's like waiting for a car to break down before fixing it.
Liveness probes automatically check if your app is healthy. If the app is stuck or crashed, Kubernetes restarts it right away. This keeps your app running smoothly without you lifting a finger.
kubectl logs myapp
# Manually check logs and restart if neededlivenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 10It enables your app to heal itself automatically, reducing downtime and keeping users happy.
A shopping website uses liveness probes to restart the payment service instantly if it freezes, so customers never face errors during checkout.
Manual health checks are slow and unreliable.
Liveness probes automate app health monitoring and recovery.
This leads to more stable and reliable applications.