kubectl exec pod/my-pod -- wget -q -O- 127.0.0.1:3000
The above kubectl exec
works.
But, when I run the same as a livenessProbe
,
livenessProbe:
exec:
command:
- /usr/bin/wget
- -q
- -O-
- 127.0.0.1:3000
it fails with wget: can't connect to remote host (127.0.0.1): Connection refused
:
Warning Unhealthy 4s kubelet Liveness probe failed: wget: can't connect to remote host (127.0.0.1): Connection refused
I was expecting the same result from kubectl exec
and the probe's exec:
.
What differences in the execution environment are causing this?