<p>Below is the current configuration for livenessProbe:</p>
<pre><code>   livenessProbe:
        httpGet:
          path: /heartbeat
          port: 8000
        initialDelaySeconds: 2
        timeoutSeconds: 2
        periodSeconds: 8
        failureThreshold: 2
</code></pre>
<hr />
<p>But response body for URL <code>.well-known/heartbeat</code> shows <code>status: &quot;DOWN&quot;</code> and the http return status as 200</p>
<p>So, Kubelet does not restart the container, due to http response status 200</p>
<hr />
<p>How to ensure Kubelet reads the response body instead of http return status? using <code>livenessProbe</code> configuration</p>

overexchange
<p>You can interpret the body in your probe using shell command, example:</p>
<pre><code>livenessProbe:
  exec:
    command:
    - sh
    - -c
    - curl -s localhost | grep 'status: &quot;UP&quot;'
</code></pre>
<p><code>grep</code> return non-zero if <code>status: &quot;DOWN&quot;</code> which will direct readinessProbe to fail. You can of course adjust the script according to your actual response body.</p>
