<p>I am adding liveness probe and readiness probe using Exec probe.<br />
My config looks like this:</p>
<pre><code>readinessProbe:
    exec:
      command: &quot;/usr/bin/jps -l | grep QueueProcess&quot;
    periodSeconds: 10 
    failureThreshold: 2
    successThreshold: 2
</code></pre>
<p>When the above one didn't work. I modified this and also tried:</p>
<pre><code>readinessProbe:
     exec:
       command: [&quot;/usr/bin/jps&quot;, &quot;-l&quot;, &quot;|&quot;, &quot;grep&quot;,&quot;QueueProcess&quot;]
     periodSeconds: 10 
     failureThreshold: 2
     successThreshold: 2
</code></pre>
<p>On running <code>kubectl describe pod</code>, got following output:</p>
<pre><code>  Normal   Created           37s                  kubelet             Created container app1
  Normal   Started           37s                  kubelet             Started container app1
  Warning  Unhealthy         6s (x3 over 26s)     kubelet             Readiness probe failed: invalid argument count
usage: jps [-help]
       jps [-q] [-mlvV] [&lt;hostid&gt;]

Definitions:
    &lt;hostid&gt;:      &lt;hostname&gt;[:&lt;port&gt;]

</code></pre>
<p>I tried another application, where I am running <code>grpcurl</code> to call health check:</p>
<pre><code>readinessProbe:
    exec:
      command: [&quot;grpcurl&quot;, &quot;-plaintext&quot;, &quot;-protoset&quot;, &quot;/app/HealthCheck.protoset&quot;, &quot;localhost:8123&quot;, &quot;service.HealthCheckService/GetHealthCheck&quot;,&quot;|&quot;, &quot;jq&quot;, &quot;.&quot;, &quot;|&quot;,&quot;grep&quot;,&quot;200&quot;]
    periodSeconds: 10 
    failureThreshold: 2
    successThreshold: 2
</code></pre>
<p>On running <code>kubectl describe pod</code> for this one, I got:</p>
<pre><code>  Normal   Created           23s                kubelet             Created container app2
  Normal   Started           23s                kubelet             Started container app2
  Warning  Unhealthy         3s (x2 over 13s)   kubelet             Readiness probe failed: Too many arguments.
Try 'grpcurl -help' for more details.

</code></pre>
<p>Both of these are failing.
The question, how can I write an <code>Exec probe</code>, which has a pipe(or multiple pipe) in it?</p>
<p>I am using EKS v1.18.<br />
(Both the above configs belong to different applications.)</p>

kadamb
<p>You need to actually use a shell, since that's a shell feature. <code>sh -c &quot;foo | bar&quot;</code> or whatever. Also remember that all the relevant commands need to be available in the target image.</p>
