<p>I have a container that has a ping endpoint (returns pong) and I want to probe the ping endpoint and see if I get a pong back. If it was just to check 200 , I could have added a liveliness check in my pod like this -></p>

<pre><code>livenessProbe:
  initialDelaySeconds: 2
  periodSeconds: 5
  httpGet:
    path: /ping
    port: 9876 
</code></pre>

<p>How do I modify this to check  to see if I get a <code>pong</code> response back? </p>

<p>As the HTTP probe only checks the status code of the response, you need to use the exec probe to run a command on the container. Something like this, which requires <code>curl</code> being installed on the container:</p>

<pre><code>livenessProbe:
  initialDelaySeconds: 2
  periodSeconds: 5
  exec:
    command:
    - sh
    - -c
    - curl -s http://localhost:9876/ping | grep pong
</code></pre>
