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.com/google_containers 参数

(2)google_containers 包的版本管理不对,有的包路径不对,有的版本号缺少V,或没有V标识,需要重新tag成正确

方案一:

  kubeadm config images list

 列出所需要版本

   1 用国内镜像源拉下来 - 》2 再改tag k8s.gcr.io/XXXX —》3 删除旧镜像

坑:这种方式不能使用 --image-repository registry.aliyuncs.com/google_containers 参数,否则会出现拉取不到 k8s.gcr.io/pause 等错误

方案二:

使用  --image-repository registry.aliyuncs.com/google_containers , 会自动根据版本拉取相应镜像

坑:有的版本会提示找不到对应报,其实是因为tag 错误,要注意对比

例如:1.21 版本 提示找不到 【registry.aliyuncs.com/google_containers/coredns/coredns:1.8.0】包

解决方案

拉取正确包: docker pull registry.aliyuncs.com/google_containers/coredns:1.8.0

重新tag : docker tag registry.aliyuncs.com/google_containers/coredns:1.8.0 registry.aliyuncs.com/google_containers/coredns/coredns:v1.8.0

注意看:有的版本提示的包版本是没有V,有的有,tag的时候要注意

  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值