k8s calico-node错误日志 listen tcp: lookup localhost on 8.8.4.4:53: no such host
Posted 牧之
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了k8s calico-node错误日志 listen tcp: lookup localhost on 8.8.4.4:53: no such host相关的知识,希望对你有一定的参考价值。
项目场景:
K8s搭建
问题描述:
查看pods状态,发现 calico-node异常
[root@k8s-master ~]# kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system calico-node-m5s7m 0/1 Running 0 25s
kube-system calico-node-s959x 0/1 Running 0 12s
查看日志提示 :
listen tcp: lookup localhost on 8.8.4.4:53: no such host
原因分析:
localhost未设置映射
解决方案:
添加localhost映射:vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
删除calico-node,重启 :kubectl delete pod calico-node-实际名称 -n kube-system
查看 :kubectl get pods --all-namespaces -o wide
[root@k8s-master ~]# kubectl get pods --all-namespaces -o wide
NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
kube-system calico-node-bs8tr 1/1 Running 0 35m 192.168.200.16 k8s-master <none> <none>
kube-system calico-node-wltbq 1/1 Running 0 34m 192.168.200.17 k8s-worker <none> <none>
以上是关于k8s calico-node错误日志 listen tcp: lookup localhost on 8.8.4.4:53: no such host的主要内容,如果未能解决你的问题,请参考以下文章
Calico 报错 calico/node is not ready: BIRD is not ready: BGP not established with(导致 K8S 集群网络无法使用)
k8s上搭建loki日志服务并通过prometheus进行错误日志告警