环境
- containerd 1.6.4
- k8s 1.24.1(1.23.5)
错误现象
Unfortunately, an error has occurred:
timed out waiting for the condition
This error is likely caused by:
- The kubelet is not running
- The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)
If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:
- 'systemctl status kubelet'
- 'journalctl -xeu kubelet'
Additionally, a control plane component may have crashed or exited when started by the container runtime.
To troubleshoot, list all containers using your preferred container runtimes CLI.
Here is one example how you may list all Kubernetes containers running in cri-o/containerd using crictl:
- 'crictl --runtime-endpoint /run/containerd/containerd.sock ps -a | grep kube | grep -v pause'
Once you have found the failing container, you can inspect its logs with:
- 'crictl --runtime-endpoint /run/containerd/containerd.sock logs CONTAINERID'
couldn't initialize a Kubernetes cluster
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/init.runWaitControlPlanePhase
日志分析
根据提示使用journalctl -xeu kubelet 查看日志,日志文件中的错误主要有四种:
- 找不到节点
Error getting node" err="node \"k8s-master\" not found
- Unable to register node with API server
- 获取不到pause镜像
May 31 09:04:45 k8s-master kubelet[12906]: E0531 09:04:45.363423 12906 remote_runtime.go:198] "RunPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = failed to get sandbox image \"k8s.gcr.io/pause:3.6\": failed to pull image \"k8s.gcr.io/paus

在尝试使用kubeadm 1.24.1创建k8s集群时遇到无法注册节点的问题。日志显示因无法获取pause镜像和cni网络初始化错误导致。解决方案包括手动拉取registry.aliyuncs.com/google_containers/pause:3.6镜像,并修改tag。问题根源是国内无法直接访问google镜像仓库,image-repository参数未完全解决问题。此外,还提到了flannel网络插件安装时的版本兼容性和证书问题。

5447

被折叠的 条评论
为什么被折叠?



