I've got a very strange networking problem trying to get elasticsearch working on a local Kubernetes cluster, and I'm completely stumped on what could be causing the issue. At this point, I don't think this is an Elasticsearch problem, I think there is something odd going on in the host machine, but I can't for the life of me figure out what it is.
TLDR version: "curl -X GET http://127.0.0.1:9200" works from inside some containers, but not other others.
The details are as follows:
I have a 4 node Kubernetes cluster for testing on two different machines.
But from there, I run into problems in one of my environments when I do the following:
kubectl get pods -A -o wide
to find out where the elasticsearch master is running.vagrant ssh
to that node.docker ps
to find out the id of the container running elasticsearch.docker exec -u root -it container_name /bin/bash
to get a shell in the container.curl -X GET http://127.0.0.1:9200/_cluster/health
, which is what Kubernetes is using for a health check. In one environment, I get back JSON. In the other, I get "Connection refused"I can't figure out why the same docker image running in the same kind of virtual machine would produce a different result on a different host.
Can anyone shed some light on this situation?