kubernetes: 1.16.3
CNI: flannel
因为Node有公网和内网两个IP,使用防火墙对机器进行安全加固
开启防火墙后,不同节点的Node之间无法通信
# Generated by iptables-save v1.4.21 on Thu Jul 8 10:16:12 2021 *filter :INPUT DROP [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [6:438] -A INPUT -i lo -j ACCEPT -A INPUT -s 127.0.0.1/32 -d 127.0.0.1/32 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -s 10.244.0.0/16 -m comment --comment "pod Subnet" -j ACCEPT -A INPUT -s 10.96.0.0/12 -m comment --comment "service Subnet" -j ACCEPT -A INPUT -s 10.241.0.0/16 -m comment --comment "lan IP" -j ACCEPT -A INPUT -p tcp -m tcp --sport 80 -j ACCEPT -A INPUT -p tcp -m tcp --sport 443 -j ACCEPT -A INPUT -p udp -m udp --sport 123 -j ACCEPT -A INPUT -p udp -m udp --dport 123 -j ACCEPT -A INPUT -p tcp -m tcp --sport 53 -j ACCEPT -A INPUT -p udp -m udp --sport 53 -j ACCEPT -A INPUT -p icmp -m icmp --icmp-type any -j ACCEPT -A INPUT -p udp -m udp --dport 161 -j ACCEPT COMMIT # Completed on Thu Jul 8 10:16:12 2021
node 节点内网全开
/etc/sysconfig/iptables
中,并重启防火墙配置UTP 8472
端口,发现也是通的-A INPUT -p udp --dport 8472 -j ACCEPT
I0903 09:57:22.857993 1 main.go:532] Using interface with name XXX and address XX.XXX.X.X I0903 09:57:22.858084 1 main.go:549] Defaulting external address to interface address (XX.XXX.X.X)
重新部署flannel,并指定使用的网卡
args: - '--ip-masq' - '--kube-subnet-mgr' - '--iface=ens192'