记一次coredns组件异常

使用rancher在azure 虚拟机部署k8s后,出现集群内服务彼此不能解析地址的错误。查询coredns组件日志如下:

[test@master .kube]$ kubectl logs coredns-bdffbc666-msvff -n kube-system
.:53
2020-12-21T05:48:06.365Z [INFO] CoreDNS-1.3.1
2020-12-21T05:48:06.365Z [INFO] linux/amd64, go1.11.4, 6b56a9c
CoreDNS-1.3.1
linux/amd64, go1.11.4, 6b56a9c
2020-12-21T05:48:06.365Z [INFO] plugin/reload: Running configuration MD5 = 45cd9f91917cc54711e243e0d08537a7
2020-12-21T05:48:12.366Z [ERROR] plugin/errors: 2 1176288680675485202.7487843879053093904. HINFO: read udp 10.42.0.5:46733->168.63.129.16:53: i/o timeout
2020-12-21T05:48:15.369Z [ERROR] plugin/errors: 2 1176288680675485202.7487843879053093904. HINFO: read udp 10.42.0.5:40822->168.63.129.16:53: i/o timeout
2020-12-21T05:48:16.366Z [ERROR] plugin/errors: 2 1176288680675485202.7487843879053093904. HINFO: read udp 10.42.0.5:49939->168.63.129.16:53: i/o timeout
2020-12-21T05:48:17.369Z [ERROR] plugin/errors: 2 1176288680675485202.7487843879053093904. HINFO: read udp 10.42.0.5:54645->168.63.129.16:53: i/o timeout
2020-12-21T05:48:20.370Z [ERROR] plugin/errors: 2 1176288680675485202.7487843879053093904. HINFO: read udp 10.42.0.5:37841->168.63.129.16:53: i/o timeout
2020-12-21T05:48:23.371Z [ERROR] plugin/errors: 2 1176288680675485202.7487843879053093904. HINFO: read udp 10.42.0.5:48717->168.63.129.16:53: i/o timeout
2020-12-21T05:48:26.372Z [ERROR] plugin/errors: 2 1176288680675485202.7487843879053093904. HINFO: read udp 10.42.0.5:59193->168.63.129.16:53: i/o timeout
2020-12-21T05:48:29.372Z [ERROR] plugin/errors: 2 1176288680675485202.7487843879053093904. HINFO: read udp 10.42.0.5:44773->168.63.129.16:53: i/o timeout
2020-12-21T05:48:32.373Z [ERROR] plugin/errors: 2 1176288680675485202.7487843879053093904. HINFO: read udp 10.42.0.5:58772->168.63.129.16:53: i/o timeout
2020-12-21T05:48:35.374Z [ERROR] plugin/errors: 2 1176288680675485202.7487843879053093904. HINFO: read udp 10.42.0.5:48729->168.63.129.16:53: i/o timeout

解决方案:

1.修改宿主机的iptable策略:
[test@master ~]$ /sbin/iptables -P FORWARD ACCEPT
2.重启rancher:
[test@master ~]$ docker rastart 928c99a37153
3.重启集群内的pod & svc

猜你喜欢

转载自blog.csdn.net/JosephThatwho/article/details/111475422