搭建k8s节点报错[ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]:
[root@k8snode2 k8s_images]# kubeadm join --token f0bc0b.7aa9033c4f7ae16c 192.168.6.7:6443 --discovery-token-ca-cert-hash sha256:ee4c3346ade1c7ce0eeb80a9cce46b7d323886012e3dd15ac49f2ba81a3f0023
[preflight] Running pre-flight checks.
[WARNING FileExisting-crictl]: crictl not found in system path
[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 Swap]: running with swap on is not supported. Please disable swap
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
处理方法:
[ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1
[root@k8snode1 k8s_images]# echo "1" >/proc/sys/net/bridge/bridge-nf-call-iptables
[ERROR Swap]: running with swap on is not supported. Please disable swap
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
[root@k8snode2 k8s_images]# swapoff -a
[root@k8snode2 k8s_images]# vim /etc/fstab
#/dev/mapper/rhel-swap swap swap defaults 0 0
[root@k8smaster k8s_images]# free -m
total used free shared buff/cache available
Mem: 992 524 74 7 392 284
Swap: 0 0 0
最后处理结果
[root@k8snode1 k8s_images]# kubeadm join --token f0bc0b.7aa9033c4f7ae16c 192.168.6.7:6443 --discovery-token-ca-cert-hash sha256:ee4c3346ade1c7ce0eeb80a9cce46b7d323886012e3dd15ac49f2ba81a3f0023
[preflight] Running pre-flight checks.
[WARNING FileExisting-crictl]: crictl not found in system path
[discovery] Trying to connect to API Server "192.168.6.7:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://192.168.6.7:6443"
[discovery] Requesting info from "https://192.168.6.7:6443" again to validate TLS against the pinned public key
[discovery] Cluster info signature and contents are valid and TLS certificate validates against pinned roots, will use API Server "192.168.6.7:6443"
[discovery] Successfully established connection with API Server "192.168.6.7:6443"
This node has joined the cluster:
* Certificate signing request was sent to master and a response
was received.
* The Kubelet was informed of the new secure connection details.
Run 'kubectl get nodes' on the master to see this node join the cluster.