The command kubectl describe pod
returns information about a specific pod. There is a section called Events
, which contains events related to a selected pod.
In case of readiness probe (httpGet) failure there will be written something like this:
Message
-------
Readiness probe failed: HTTP probe failed with statuscode: 503
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.
Is it possible to add the response of the http probe straight to the output of kubectl describe pod
so I don't have to curl this pod?
As I understand, I can set readiness probe as a exec
, but I think there could be a simpler solution.
The example of the httpGet probe:
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
To debug the response of HTTP GET
of your program at healthz
endpoint, you can port-forward
your pod to the local machine, and check the response body by yourself.
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 1000 # something like this
periodSeconds: 5
kubectl port-forward
:$ kubectl port-forward -n <namespace> <pod-name> 8080:8080
curl
command to test response:$ curl -XGET "localhost:8080/healthz"