k8s 部分节点 nodelocaldns [ERROR] Failed to read node-cache coreFile /etc/coredns/Corefile.base

 

 

部分K8S节点nodelocaldns CrashLoopBackOff状态报错,报错信息如下:

# kubectl logs nodelocaldns-w9mgz -n kube-system
2023/08/07 03:18:33 [INFO] Using Corefile /etc/coredns/Corefile
2023/08/07 03:18:33 [ERROR] Failed to read node-cache coreFile /etc/coredns/Corefile.base - open /etc/coredns/Corefile.base: no such file or directory
2023/08/07 03:18:33 [ERROR] Failed to sync kube-dns config directory /etc/kube-dns, err: lstat /etc/kube-dns: no such file or directory
Listen: listen tcp 169.254.25.10:53: bind: address already in use

 

 

问题原因:

  端口被占用,netstat -tulpn | grep 53 查询端口被谁占用,发现是一个叫named的,这是bind9服务,为什么bind9为占用53呢?

 

 

解决办法:

  登录相应服务器节点操作

  1、直接重启服务器,简单高效

       2、service bind9 stop  杀掉bind9, 再重启nodelocaldns, 最后service bind9 start

 

posted @ 2023-08-07 11:34  龙虚度  阅读(675)  评论(0编辑  收藏  举报