WARN log metricbeat pods (on kubernetes) : DNS lookup failure "k8s-node4": lookup k8s-node4 on 10.96.0.10:53: no such host

10/20/2019

I install metricbeat via official helm charts (default value).

But, inside log files I observed that :

kubectl -n logging logs metricbeat-metricbeat-ljjfx :

2019-10-20T10:22:57.191Z    WARN    transport/tcp.go:53 DNS lookup failure "k8s-node4": lookup k8s-node4 on 10.96.0.10:53: no such host
2019-10-20T10:23:01.196Z    WARN    transport/tcp.go:53 DNS lookup failure "k8s-node4": lookup k8s-node4 on 10.96.0.10:53: no such host
2019-10-20T10:23:02.143Z    WARN    transport/tcp.go:53 DNS lookup failure "k8s-node4": lookup k8s-node4 on 10.96.0.10:53: no such host
2019-10-20T10:23:03.867Z    WARN    transport/tcp.go:53 DNS lookup failure "k8s-node4": lookup k8s-node4 on 10.96.0.10:53: no such host
2019-10-20T10:23:06.364Z    WARN    transport/tcp.go:53 DNS lookup failure "k8s-node4": lookup k8s-node4 on 10.96.0.10:53: no such host
-- DevOpsAddict
kubernetes
metricbeat
warnings

1 Answer

10/21/2019

That kind of error indicates that you should look into your DNS policy. More details can be found here. In short, you need this config to be added:

hostNetwork: true  
dnsPolicy: ClusterFirstWithHostNet  

Please let me know if that helped.

-- OhHiMark
Source: StackOverflow