Metricbeat in Kubernetes fails to find Elasticsearch host

metricbeat 6.2.3/elasticsearch 6.2.2/kubernetes 1.9
ERROR pipeline/output.go:74 Failed to connect: Get http://elasticsearch:9200: lookup elasticsearch on no such host

config values:

Where does '' come from? No such IP in system?
Works fine if host is changed to Kubernetes internal Cluster IP created for Elasticsearch service.

Interestingly, Filebeat has a similar config, but is able to resolve elasticsearch:9200 host

Hi @bladedrunner512,

That IP is the DNS server, the error comes from its answer.

In order to debug why Metricbeat cannot resolve elasticsearch we would need some more info about your deploy, like Metricbeat manifests and how elasticsearch is deployed. I understand there is an elasticsearch service in the same namespace?

Best regards

On a second though, I'm guessing this is related to hostNetwork: true. Have a look to You can probably add dnsPolicy: ClusterFirstWithHostNet to fix this issue.

Please let me know if that fixes the issue, we may want to put that in the official manifest.

Best regards

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.