首页 > 其他分享 >kubeadm init过程报错解决

kubeadm init过程报错解决

时间:2024-01-30 15:46:08浏览次数:28  
标签:docker etc -- ARGS kubelet init 报错 kubeadm KUBELET

1、问题

kubeadm init初始化kubesphere集群的时候遇到如下错误:

  • 1)错误1:
W0613 15:49:11.550029    2140 images.go:80] could not find officially supported version of etcd for Kubernetes v1.27.2, falling back to the nearest etcd version (3.5.7-0)
[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)

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 running Kubernetes containers by using crictl:
        - 'crictl --runtime-endpoint unix:///var/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 unix:///var/run/containerd/containerd.sock logs CONTAINERID'
error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster
To see the stack trace of this error execute with --v=5 or higher


  • 2)错误2:kubelet 服务无法启动报 code=exited, status=1/FAILURE错误

2、解决方法

  • 1)即docker的驱动与kubelet 驱动不一致
(1)查看docker驱动

root@rancher-master:~# docker info | grep Cgroup
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
WARNING: No swap limit support
(2) 查看kubelet驱动

root@rancher-master:~# cat /var/lib/kubelet/config.yaml | grep cgroup
cgroupDriver: systemd
(3) 修改docker驱动,查看/etc/docker/daemon.json文件,没有的话,手动创建,添加以下内容

{
   "exec-opts": ["native.cgroupdriver=systemd"]
}
(4) 
systemctl daemon-reload
systemctl restart docker


  • 2)/etc/systemd/system/kubelet.service.d下是否有10-kubeadm.conf.如果没有需要创建这个文件,并复制如下内容。
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml"
Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true --fail-swap-on=false"
EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env
# This is a file that the user can use for overrides of the kubelet args as a last resort. 
EnvironmentFile=-/etc/default/kubelet
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS


标签:docker,etc,--,ARGS,kubelet,init,报错,kubeadm,KUBELET
From: https://www.cnblogs.com/zhangzl419/p/17997252

相关文章

  • 使用 kubeadm 进行证书管理
    使用kubeadm进行证书管理1检查证书是否过期你可以使用check-expiration子命令来检查证书何时过期kubeadmcertscheck-expiration输出类似于以下内容:[root@k8s-master/]#kubeadmcertscheck-expiration[check-expiration]Readingconfigurationfromthecluster.......
  • MySQL建索引报错:BLOB/TEXT column used in key specification without a key length
    MySQL建索引报错:BLOB/TEXTcolumnusedinkeyspecificationwithoutakeylength因为text类型的字段值太长,没办法为全部内容建立索引,只能指定前多少位字符建立索引;就像这样createindex`索引名`on表名(字段名(600));所以能用varchar能放下的尽量使用varchar吧......
  • pyinstaller -noconsole报错win32ctypes.pywin32.pywintypes.error: (225, '', '无法
    将pyinstaller6.3.0,卸载后,安装6.2.0重新打包即可https://www.cnblogs.com/uoky/p/17916300.html但是使用-w或者--noconsole就会报错win32ctypes.pywin32.pywintypes.error:(225,'','无法成功完成操作,因为文件包含bingdu或潜在的垃圾软件。')......
  • Python中__init__.py的作用
    Pytorch学习笔记-(__init__)_pytorch3.8的init文件-CSDN博客 (推荐)Python:__init__.py的作用-知乎(zhihu.com) (推荐)Python中的__init__.py与模块导入___init__.py导入自定义py-CSDN博客你常常看到的__init__.py到底是个啥?-知乎(zhihu.com) 总结一下Python中__ini......
  • IDEA编译报错:Error:Kotlin: Module was compiled with an incompatible version of Ko
    问题Error:Kotlin:ModulewascompiledwithanincompatibleversionofKotlin.Thebinaryversionofitsmetadatais1.6.0,expectedversionis1.1.13.Warning:Kotlin:RuntimeJARfilesintheclasspathshouldhavethesameversion.Thesefileswerefoundi......
  • kubeadm安装Kubernetes集群踩坑笔记
    目录背景步骤一安装DockerEngine步骤二:安装前配置步骤三:安装kubeadm步骤四:安装kubernetes的Master节点镜像准备开始安装安装Flannel网络插件步骤五:安装kubernetes的Worker节点总结思考背景最近在极客时间上跟Chrono大神学习Kubernetes基础,在实践过程中遇到一些运维、使用方面......
  • vue安装node-sass sass-loader 报错
    vue安装node-sass  sass-loader报错 主要的原因是因为node的版本 和  node-sass  sass-loader 不匹配导致的报错node-sass版本和sass-loader版本对应 具体查看这个链接   https://www.npmjs.com/package/node-sass拿我当前项目举例  我node版本是16......
  • 关于ufw 报错ip6tables v1.6.1: can't initialize ip6tables table `filter': Table d
    背景在ubuntuarm版本上安装ufw,设置规则时报错发现报错ip6tablesv1.6.1:can'tinitializeip6tablestable`filter':Tabledoesnotexist(doyouneedtoinsmod?)Perhapsip6tablesoryourkernelneedstobeupgraded.解决办法一.升级ip6tables二.禁用i......
  • 在Python中,子类继承父类并调用父类的构造方法有几种方式: 1. 如果子类没有重写`__init
    在Python中,子类继承父类并调用父类的构造方法有几种方式:1.如果子类没有重写`__init__`,实例化子类时,会自动调用父类定义的`__init__`¹。```pythonclassFather(object):  def__init__(self,name):    self.name=nameclassSon(Father):  passson=So......
  • linux centos yum 报错[Errno 256]No more mirrors to try 解决方法
    解决方案大致有三种一、更新yum二、若不行,可能是因为DNS不稳定吧,因为yum安装时会从三个”repo源“(base,extras,updates)随机获取地址背景我使用yum方式安装软件时,比如zabbix这种软件,我们在安装时一般都是直接到zabbix官网,按照官方的步骤进行安装,但是有一个问题,官方的服务器不在国......