calico报错Calico requires net.ipv4.conf.all.rp_filter to be set to 0 or 1

「爱情、让人受尽委屈。」 2022-09-12 01:56 102阅读 0赞

网上的文章都是介绍,在 k8s 中部署时的解决方案:如下
calico报错Calico requires net.ipv4.conf.all.rp_filter to be set to 0 or 1
calico报错:

  1. int_dataplane.go 1018: Kernel's RPF check is set to 'loose'. This would allow endpoints to spoof their IP address. Calico requires net.ipv4.conf.all.rp_filter to be set to 0 or 1. If you require loose RPF and you are not concerned about spoofing, this check can be disabled by setting the IgnoreLooseRPF configuration parameter to 'true'.

解决方法:

  1. kubectl -n kube-system set env daemonset/calico-node FELIX_IGNORELOOSERPF=true

而我是通过 docker 直接去装 Calico 的,以上方法行不通;

仔细看报错中,有两处提示

  • Calico requires net.ipv4.conf.all.rp_filter to be set to 0 or 1.
  • setting the IgnoreLooseRPF configuration parameter to ‘true

网上大部分解决方案即为第二种方案(如上文)。

既然第二种行不通,直接用第一种修改 内核参数,应该同样能解决问题,执行如下命令

  1. sysctl net.ipv4.conf.all.rp_filter=0

问题解决

发表评论

表情:
评论列表 (有 0 条评论,102人围观)

还没有评论,来说两句吧...

相关阅读