集群时报错的坑"/>
kubeadm init初始化k8s集群时报错的坑
其他错误都基本可以百度解决,唯独这个错误搞了好久
错误:
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory “/etc/kubernetes/manifests”. This can take up to 4m0s
[kubelet-check] Initial timeout of 40s passed.
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)
莫名其妙各种提示的错误和实际的问题不对应
-------------------------------------------------------
主要问题根源:
(1)--image-repository registry.aliyuncs/google_containers 参数
(2)google_containers 包的版本管理不对,有的包路径不对,有的版本号缺少V,或没有V标识,需要重新tag成正确
方案一:
kubeadm config images list
列出所需要版本
1 用国内镜像源拉下来 - 》2 再改tag k8s.gcr.io/XXXX —》3 删除旧镜像
坑:这种方式不能使用 --image-repository registry.aliyuncs/google_containers 参数,否则会出现拉取不到 k8s.gcr.io/pause 等错误
方案二:
使用 --image-repository registry.aliyuncs/google_containers , 会自动根据版本拉取相应镜像
坑:有的版本会提示找不到对应报,其实是因为tag 错误,要注意对比
例如:1.21 版本 提示找不到 【registry.aliyuncs/google_containers/coredns/coredns:1.8.0】包
解决方案
拉取正确包: docker pull registry.aliyuncs/google_containers/coredns:1.8.0
重新tag : docker tag registry.aliyuncs/google_containers/coredns:1.8.0 registry.aliyuncs/google_containers/coredns/coredns:v1.8.0
注意看:有的版本提示的包版本是没有V,有的有,tag的时候要注意
更多推荐
kubeadm init初始化k8s集群时报错的坑
发布评论