I’m trying to integrate liveness probes in our Cloud Run deployments. We are running Flask APIs in these deployments.
All seems to work fine if I follow the following setup in the yaml:
livenessProbe:
timeoutSeconds: 3
periodSeconds: 10
failureThreshold: 3
httpGet:
path: /health
port: 5000
In the logs of the deployment, we see the liveness probe attempts - per the following format:
werkzeug | INFO : 169.254.1.1 - - [25/Apr/2024 14:40:27] "GET /health HTTP/1.1" 200 -
However, when I check out the Cloud Run metrics, the completed probe attempts stays at zero.
Our health check is structured as follows:
<li-user uid="318564" login="App"></li-user>.route("/health")
def health_check():
"""Route for liveness probe."""
return "OK", 200
As we can’t see how Cloud Run handles the response from Flask, it feels a bit like driving blind.
Any suggestions would be much appreciated!