You have your apps on Kubernetes.
Mutha Nagavamsi
Kubernetes, Devops, Cloud & Tech. I run a supercool k8s community, do join. 75K+ strong all socials ??
And they do some very important work.
But over time they might stop working properly.
So your apps need help. And that's when liveness probes comes in.
What do liveness probes do?
Liveness probes regularly asks your app/pod to do a simple work.
If it can't, the probe know something's wrong.
And so it gently restarts the affected Pod.
The new Pod means happy and healthy app ??
What happens if it's configured wrong?
They become counterproductive. They can raise false positives and can do more damage than good.
Imagine if you have a web app as a Pod and it's liveness probes are configured wrong.
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 2 # Too frequent.
periodSeconds: 2 # Too frequent.
What's wrong with this config?
initialDelaySeconds: 2 and periodSeconds: 2.
领英推荐
This probe runs every 2 seconds, this is too frequent.
Recommendation:
Have some reasonable interval, such as 10-30 seconds. Set it based on your app's response times and health check requirements.
Also, don't use complex scripts. Let's say scripts that take 5 seconds to finish. Don't use them.
Hope this short read is useful.
A Repost helps ??
Consistency conquers all hurdles → Keep showing up ??
Share your thoughts. Did you learn anything today?
Thank you so much for reading this. If you found it interesting, do spread the word about it. You may also find my other content interesting, find them below.
1. Mutha Nagavamsi on Youtube. (Subscribe, it really helps)
3. Me on X.