K8S网络排故障一则--iptables规则

这个故障源起来在k8s上同时安装ceph群集(测试的时候机器不多啊)

当这两者都OK之后,原来k8s上的服务实例,则有的通,有的不通了。

====================

所有可能的故障点,flannel,kubelet,kubeproxy都排查过之后,

定位在Iptable,

但net.ipv4.ip_forward = 1这种配置我是有的。

====================

我同时输出一份正常和不正常的iptables配置。

发现了一个点:

在不通的机器上,IPTABLES将FORWARD转发DROP掉了。

于是启用之后,一切都平静了。。

但。。。这个规则是啥时加入的呢?

ceph自已加入的???

看来,以后不能混锅炖了?

====================

iptables -L

Chain FORWARD (policy DROP)
target     prot opt source               destination         
DOCKER-ISOLATION  all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
DROP       all  --  anywhere             anywhere       

运行命令:

iptables -P FORWARD ACCEPT

搞定。本来正常时的设置。

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
DOCKER-ISOLATION  all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值