排错参考

1. nodelocaldns CrashLoopOff

  • https://www.cxymm.net/article/xdbrcisco/117442590

  • 删除了 nodelocaldns 和 coredns 的 loop 插件

  • 删除重启 pod

kube-system     nodelocaldns-ccnlj                            0/1     CrashLoopBackOff   134 (4m7s ago)   11h
kube-system     nodelocaldns-cr7t6                            1/1     Running            3 (11h ago)      11h

[root@cluster2-master01 ~]# kubectl -n kube-system logs -f nodelocaldns-ccnlj
2022/08/24 01:31:55 [INFO] Starting node-cache image: 1.21.1
2022/08/24 01:31:55 [INFO] Using Corefile /etc/coredns/Corefile
2022/08/24 01:31:55 [INFO] Using Pidfile 
2022/08/24 01:31:55 [ERROR] Failed to read node-cache coreFile /etc/coredns/Corefile.base - open /etc/coredns/Corefile.base: no such file or directory
2022/08/24 01:31:55 [INFO] Skipping kube-dns configmap sync as no directory was specified
in-addr.arpa.:53 on 169.254.25.10
ip6.arpa.:53 on 169.254.25.10
.:53 on 169.254.25.10
cluster.local.:53 on 169.254.25.10
[INFO] plugin/reload: Running configuration MD5 = adf97d6b4504ff12113ebb35f0c6413e
CoreDNS-1.7.0
linux/amd64, go1.16.8, 
[FATAL] plugin/loop: Loop (10.10.36.10:53617 -> 169.254.25.10:53) detected for zone "in-addr.arpa.", see https://coredns.io/plugins/loop#troubleshooting. Query: "HINFO 3686897180503030578.6192104512964945672.in-addr.arpa."

2. coredns 总是 timeout

  • https://github.com/kubernetes/kubernetes/issues/86762

  • 添加 iptables 规则,重启 coredns

iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
[root@cluster2-master01 ~]# kubectl -n kube-system logs -f coredns-79d4d974cb-mp87c
.:53
[INFO] plugin/reload: Running configuration MD5 = ca1e9782bd024dcb7de0353d6034aad8
CoreDNS-1.8.0
linux/amd64, go1.15.3, 054c9ae
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐