记Kubernetes(k8s) 节点kubeadm join报错:[ERROR FileContent--proc-sys-net-ipv4-ip_forward]
时间:2024-04-09 11:15:44 来源:网络cs 作者:峨乐 栏目:防关联工具 阅读:
记Kubernetes(k8s) 节点kubeadm join报错:[ERROR FileContent--proc-sys-net-ipv4-ip_forward]
1、报错一、kubeadm join报错:[ERROR FileContent--proc-sys-net-ipv4-ip_forward]1、报错详情2、报错解决3、重新运行 kubeadm join 命令以加入 Kubernetes 集群 2、报错二、[ERROR CRI]: container runtime is not running: output: E0403 18:04:53.2196121、报错详情2、报错解决3、重新运行 kubeadm join 命令以加入 Kubernetes 集群
💖The Begin💖点点关注,收藏不迷路💖 |
1、报错一、kubeadm join报错:[ERROR FileContent–proc-sys-net-ipv4-ip_forward]
1、报错详情
[root@k8s-node01 local]# kubeadm join k8s-master:6443 --token lad5yi.ib6gterchvmkw2xd --discovery-token-ca-cert-hash sha256:eb567a446cd6a0d79da694f4ab23b5c7bf2be4df86f4aecfadef07716fbabd2b --cri-socket unix:///var/run/cri-dockerd.sock[preflight] Running pre-flight checkserror execution phase preflight: [preflight] Some fatal errors occurred:[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[root@k8s-node01 local]#
2、报错解决
这个错误提示显示了一个预检错误,指出 /proc/sys/net/ipv4/ip_forward 的内容未设置为 1。在 Kubernetes 的预安装检查中,这是一个必要的设置,它允许数据包在节点之间进行转发。
要解决这个问题,需要设置 /proc/sys/net/ipv4/ip_forward 的值为 1。
编辑 /etc/sysctl.conf 文件并确保以下行存在:
net.ipv4.ip_forward = 1
保存并退出文件,然后运行以下命令使更改生效:
sysctl -p
3、重新运行 kubeadm join 命令以加入 Kubernetes 集群
[root@k8s-node01 ~]# kubeadm join k8s-master:6443 --token lad5yi.ib6gterchvmkw2xd \> --discovery-token-ca-cert-hash sha256:eb567a446cd6a0d79da694f4ab23b5c7bf2be4df86f4aecfadef07716fbabd2b \> --cri-socket unix:///var/run/cri-dockerd.sock[preflight] Running pre-flight checks[preflight] Reading configuration from the cluster...[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"[kubelet-start] Starting the kubelet[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...This node has joined the cluster:* Certificate signing request was sent to apiserver and a response was received.* The Kubelet was informed of the new secure connection details.Run 'kubectl get nodes' on the control-plane to see this node join the cluster.[root@k8s-node01 ~]#
2、报错二、[ERROR CRI]: container runtime is not running: output: E0403 18:04:53.219612
1、报错详情
[root@k8s-node01 ~]# kubeadm join k8s-master:6443 --token uf3sgs.ps01p9uoukky3rgp \> --discovery-token-ca-cert-hash sha256:a62bb47d0320336c4a558ab91763516e2f0f1cb80e1ab5d96f69ec82237a5653 \> --cri-socket unix:///var/run/cri-dockerd.sock[preflight] Running pre-flight checkserror execution phase preflight: [preflight] Some fatal errors occurred:[ERROR CRI]: container runtime is not running: output: E0403 18:04:53.219612 4260 remote_runtime.go:616] "Status from runtime service failed" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /var/run/cri-dockerd.sock: connect: no such file or directory\""time="2024-04-03T18:04:53+08:00" level=fatal msg="getting status of runtime: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /var/run/cri-dockerd.sock: connect: no such file or directory\"", error: exit status 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、报错解决
1、查看containerd状态
systemctl status containerd
2、编辑vim /etc/containerd/config.toml 文件
vim /etc/containerd/config.toml
将disabled_plugins = ["cri"]注释该行或将"cri"删掉
3、重启containerd
修改的内容重启后生效
systemctl restart containerd
3、重新运行 kubeadm join 命令以加入 Kubernetes 集群
[root@k8s-node02 ~]# kubeadm join k8s-master:6443 --token uf3sgs.ps01p9uoukky3rgp \> --discovery-token-ca-cert-hash sha256:a62bb47d0320336c4a558ab91763516e2f0f1cb80e1ab5d96f69ec82237a5653[preflight] Running pre-flight checks[preflight] Reading configuration from the cluster...[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"[kubelet-start] Starting the kubelet[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...This node has joined the cluster:* Certificate signing request was sent to apiserver and a response was received.* The Kubelet was informed of the new secure connection details.Run 'kubectl get nodes' on the control-plane to see this node join the cluster.[root@k8s-node02 ~]#
💖The End💖点点关注,收藏不迷路💖 |
本文链接:https://www.kjpai.cn/news/2024-04-09/155905.html,文章来源:网络cs,作者:峨乐,版权归作者所有,如需转载请注明来源和作者,否则将追究法律责任!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
上一篇:【Linux】su、sudo 等 “切换用户” 命令
下一篇:返回列表