kubeadm init初始化k8s集群时报错的坑

编程入门 行业动态 更新时间:2024-10-14 22:20:55

kubeadm init初始化k8s<a href=https://www.elefans.com/category/jswz/34/1771240.html style=集群时报错的坑"/>

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集群时报错的坑

本文发布于:2024-02-27 17:24:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1707530.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:集群   初始化   时报   kubeadm   init

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!