You have your apps on Kubernetes.
Consistency Compounds.

You have your apps on Kubernetes.

And they do some very important work.

But over time they might stop working properly.

  • Because of a glitch.
  • Or maybe it's stuck.

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.

  • Choose the most appropriate probe type (HTTP, TCP, or Exec) for your application's health checks.
  • Monitoring: Track probe results and container restarts to fine-tune configuration and identify potential issues.

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)

2. Me on Substack.

3. Me on X.

要查看或添加评论,请登录

社区洞察

其他会员也浏览了