0

Is it possible to set a liveness probe to check that a separate service is existing? For an app in one pod, and a database in a separate pod, I would like for the app pod to check the liveness of the database pod rather than this pod itself. The reason for this is that once the db is restarted, the app is unable to reconnect to the new database. My idea is to set this so that when the db liveness check fails, the app pod is automatically restarted in order to make a fresh connection to the new db pod.

mmiara
  • 305
  • 1
  • 4
  • 14
  • have you control over the code in the app with the pod? – Matt Feb 26 '20 at 19:34
  • Care to clarify a little further? which app? why don't the app check for active conectivity with the db? why it needs the pod probe to check if the app has connection with the DB? post feasible outputs and configurations so we can try and reproduce your issue. – Will R.O.F. Feb 27 '20 at 16:56
  • For now, it appears this is a non-issue. The logs show that there is an error connecting to the DB, but I am able to connect to the web app (the logs do not show anything about a reconnection being made, only the db disconnect error). I believe the best way to solve the issue long-term would be to add something into the application that shows the reconnection being made. – mmiara Feb 27 '20 at 18:21

1 Answers1

1

No, you would need to write that in a script or as part of your http endpoint.

coderanger
  • 52,400
  • 4
  • 52
  • 75