<p>The command <code>kubectl describe pod</code> returns information about a specific pod. There is a section called <code>Events</code>, which contains events related to a selected pod.</p>
<p>In case of readiness probe (httpGet) failure there will be written something like this:</p>
<pre><code>Message
------- 
Readiness probe failed: HTTP probe failed with statuscode: 503
</code></pre>
<p>However, it's not clear what the reason is and I would like to see the response body of the readiness probe, because in the response I can specify a message that explains the reason.</p>
<p>Is it possible to add the response of the http probe straight to the output of <code>kubectl describe pod</code> so I don't have to curl this pod?</p>
<p>As I understand, I can set readiness probe as a <code>exec</code>, but I think there could be a simpler solution.</p>
<p>The example of the httpGet probe:</p>
<pre><code>readinessProbe:
  httpGet:
    path: /healthz
    port: 8080
  initialDelaySeconds: 10
  periodSeconds: 5
</code></pre>

<p>To debug the response of <code>HTTP GET</code> of your program at <code>healthz</code> endpoint, you can <code>port-forward</code> your pod to the local machine, and check the response body by yourself.</p>
<ol>
<li>First of all, you need to increase the initial delay so that you have enough time to test:</li>
</ol>
<pre><code>readinessProbe:
  httpGet:
    path: /healthz
    port: 8080
  initialDelaySeconds: 1000 # something like this
  periodSeconds: 5
</code></pre>
<ol start="2">
<li>Once your pod is running, use <code>kubectl port-forward</code>:</li>
</ol>
<pre><code>$ kubectl port-forward -n &lt;namespace&gt; &lt;pod-name&gt; 8080:8080
</code></pre>
<ol start="3">
<li>Now use <code>curl</code> command to test response:</li>
</ol>
<pre><code>$ curl -XGET &quot;localhost:8080/healthz&quot;
</code></pre>
