Question on livenessprobe and restart policy: I understand we just need restart . . .

Hailu Meng:
Question on livenessprobe and restart policy: I understand we just need restart on failure if the application in container IS ABLE to fail by itself like crash by itself. Otherwise, we should leverage livenessprobe with restart policy set as always or on failure to restart the pod when the application fails, correct understanding?

Vitor Jr.:
Hi @Hailu Meng, you’re correct. For example, an application with an intermittent bug that makes a java backend stop working, but doesn’t return an error code, would be a good candidate. Otherwise, you don’t even have to use the liveness since the default behaviour is to restart when it isn’t working (like an OOM scenario, for example).

Hailu Meng:
Thanks @Vitor Jr. . It makes sense especially with backend error. The app itself can be okay but the dependency is broken. You are right, if the app crashes by itself, the default value would work for that scenario.