<p>What is the best way to handle the results returned (in this case, json) from a liveness/readiness probe to indicate success or failure?</p>

<p>returned json:
{"status":"ok","data":[],"count":0}</p>

<p>thanks.</p>

<p>It is better if http status code can be used to indicate health (can be used in addition to response body). Then you can use an http probe. I've not seen the body used in an http probe so to do that and can't see anything in the API for the httpget action for parsing the response body ( <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#httpgetaction-v1-core" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#httpgetaction-v1-core</a>). So you probably have to use an exec/command probe instead and perform a curl. </p>

<p>So <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-a-liveness-command" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-a-liveness-command</a> rather than <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-a-liveness-http-request" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-a-liveness-http-request</a></p>
