💖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 checks
error 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 checks
error 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 ~]#
文章来源:https://www.toymoban.com/news/detail-851584.html
文章来源地址https://www.toymoban.com/news/detail-851584.html
💖The End💖点点关注,收藏不迷路💖
|
到了这里,关于记Kubernetes(k8s) 节点kubeadm join报错:[ERROR FileContent--proc-sys-net-ipv4-ip_forward]的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!