k8s添加node节点报[FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]

1、添加node节点如下报错

[root@kubernetes-node4 ~]# kubeadm join 192.168.122.154:6443 --token 0yo3dc.zdfogqsfsvem4693 \
>     --discovery-token-ca-cert-hash sha256:a1c3fe8911f853ff91fafadb6a123d85e8ab7233dc6sc925d6e877c9659a9645
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1
        [ERROR FileContent--proc-sys-net-ipv4-ip_forward]: /proc/sys/net/ipv4/ip_forward contents are not set to 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher

2、解决方法如下:
2.1、执行以下命令即可

[root@kubernetes-node4 ~]# sysctl -w net.ipv4.ip_forward=1 
net.ipv4.ip_forward = 1
[root@kubernetes-node4 ~]# echo "1" >/proc/sys/net/bridge/bridge-nf-call-iptables

3、执行上面命令即可解决以上报错信息

你可能感兴趣的:(kubernetes,容器,云原生)