Correct implementation for Kubernetes Liveness and Readiness probes Correct implementation for Kubernetes Liveness and Readiness probes kubernetes kubernetes

Correct implementation for Kubernetes Liveness and Readiness probes


I would not check any of these things in Kubernetes probes. Have your application startup check for them on its own, and if the environment isn't suitable, exit immediately. Your pod will show up in CrashLoopBackOff state, and it will restart a couple of times, but it will be very clear that something is wrong.

There is some possibility that these things will fail while the application is running, but you should be able to notice this. A metrics system like Prometheus can help you notice if most of your S3 requests are failing, for example. If you can check to see if your Kafka listener main loop has exited, you can also just restart it.