这篇文章介绍一下k3s集群创建时,firewalld需要设定的规则和开放的端口。
iptables -F的后果
如果不关闭firewalld,仅仅使用iptables -F清除规则和限制,确实能够好用,但是一旦当Master节点重新启动之后,就会出现如下类似的情况。
- Node节点提示错误信息
错误信息示例如下所示:
level=error msg="failed to get CA certs at https://127.0.0.1:43849/cacerts: Get https://127.0.0.1:43849/cacerts: read tcp 127.0.0.1:37820->127.0.0.1:43849: read: connection reset by peer"
- Master节点显示Node节点都NotReady
[root@host121 ~]# kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
host122 NotReady <none> 14m v1.16.3-k3s.2 192.168.163.122 <none> CentOS Linux 7 (Core) 3.10.0-957.el7.x86_64 containerd://1.3.0-k3s.4
host124 NotReady <none> 14m v1.16.3-k3s.2 192.168.1