只是初始化一個集群,沒想到如此艱辛。
初始化集群使用如下命令:
sudo kubeadm init --kubernetes-version=v1.26.1 --ignore-preflight-errors=all
結(jié)果出現(xiàn)如題所示問題:
waiting for the kubelet to boot up the control plane as Static Pods from directory “/etc/kubernetes/manifests”
this might take a minute or longer if the control plane images have to be pulled
Unfortunately, an error has occurred:
timed out waiting for the condition
…
結(jié)合日志中的內(nèi)容journalctl -xeu kubelet,搜索各種可能出現(xiàn)的問題,如下:文章來源:http://www.zghlxwxcb.cn/news/detail-459238.html
- The kubelet is not running:這個問題確認不存在, 查看kubelet的狀態(tài)是running.
- The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled): 這個可能性不能確認,但是關于cgroup的配置已經(jīng)檢查過幾遍,應該也沒有問題.
- 日志中skipping pod synchronization:這個信息也沒有搜索到什么結(jié)果。
- Failed to read checkpoint for “kubelet_internal_checkpoint”:這個信息也沒有找到問題的原因。
- container runtime status check may not have complete PLEG is not healthy: 沒有找到原因。
在自己的努力堅持下,終于看到這條內(nèi)容:this might take a minute or longer if the control plane images have to be pulled #1023(https://github.com/kubernetes/kubeadm/issues/1023), 嘗試一下,沒想到竟然成功了!方法就是修改/lib/systemd/system/kubelet.service,添加kubelet啟動參數(shù)如下:
[Service]
ExecStart=/usr/bin/kubelet --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml
…
然后,重啟計算機,執(zhí)行sudo kubeadm reset 后重新執(zhí)行sudo kubeadm init,成功進行了初始化:
[apiclient] All control plane components are healthy after 13.501844 seconds
[upload-config] Storing the configuration used in ConfigMap “kubeadm-config” in the “kube-system” Namespace
[kubelet] Creating a ConfigMap “kubelet-config” in namespace kube-system with the configuration for the kubelets in the cluster
…
現(xiàn)在回想起來,真是一把辛酸淚,還真是最開始提示的問題:“The kubelet is unhealthy due to a misconfiguration ”,但是誰要能想到是什么問題呢?文章來源地址http://www.zghlxwxcb.cn/news/detail-459238.html
到了這里,關于歷盡艱辛的問題:Waiting for the kubelet to boot up the control plane......This can take up to 4m0s的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!