kubernetes redinessProbe httpGet on tomcat image reports connection refused
Exec works because that's being executed within the container where localhost:8080 is available.But httpGet is executed by Kubelet.So when host is specified as localhost, it tries to connect to port 8080 on the node. Hence the failure.
Please remove "host: localhost" in probe so that it'll default to pod ip and will work as expected.
when i was developing the deployment, i used the /manager/html as the path for httpGet probe. Which was not working due to 404 error.
To fix it, i tried out few option including host localhost, after changing the path i didn't remove the localhost. As mentioned by @Naga venkata Pradeep Namburi.
Kubelet uses the container ip for httpGet, specifying host : localhost
it assumes the localhost of node rather than the container itself.
readinessProbe: initialDelaySeconds: 60 httpGet: # host: localhost # -- remove this local host path: /temp/index.html port: 8080