首页 > 其他分享 >关于Kubernetes-v1.23.6-初始化时报错[kubelet-check] It seems like the kubelet isn't running or healthy

关于Kubernetes-v1.23.6-初始化时报错[kubelet-check] It seems like the kubelet isn't running or healthy

时间:2023-05-07 10:12:51浏览次数:45  
标签:http Kubernetes healthy healthz kubelet 10248 check localhost

笔者今天在对k8s,v1.23.6版本的的master节点使用如下命令进行初始化时

[root@k8s-master qq-5201351]# kubeadm init \
> --apiserver-advertise-address 192.18.106.87 \
> --image-repository registry.aliyuncs.com/google_containers \
> --kubernetes-version v1.23.6 \
> --service-cidr=10.96.0.0/12 \
> --pod-network-cidr=10.224.0.0/16

遇到如下报错:

[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.
[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.
[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.
[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.
[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.
[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.

        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 Kubernetes containers running in docker:
                - 'docker ps -a | grep kube | grep -v pause'
                Once you have found the failing container, you can inspect its logs with:
                - 'docker 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

其核心报错,也就如下几条,最为主要的就是说,kubelet isn't running or healthy.

[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifes ts". This can take up to 4m0s
[kubelet-check] Initial timeout of 40s passed.
[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248 /healthz": dial tcp [::1]:10248: connect: connection refused.

刚看到这个报错时,还是有一点懵的,但仔细一看,还好下面提出了一些排查方法,和可能的原因 ,其中有一点看起来很是有用

- The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)

这个与docker的一个配置有关系,即要求将cgroups disabled,于是笔者尝试如下解决方法

到/etc/docker/daemon.json配置文件中,至少需要添加上如下一段内容(如果有其他配置选项也可以添加到花括号之中)

{
"exec-opts":["native.cgroupdriver=systemd"]
}

说明:docker默认使用的Cgroup Driver是cgroupfs,我们上面是将其修改成systemd,这些通过docker info可以看出

然后我们重启docker让配置生效,因为这才刚开始从master节点搭建,于是笔者再使用kubeadm reset重置

最后我们再进行kubadm初始化master节点时,就不会有报错了~

 

 

 

尊重别人的劳动成果 转载请务必注明出处:https://www.cnblogs.com/5201351/p/17378926.html

 

标签:http,Kubernetes,healthy,healthz,kubelet,10248,check,localhost
From: https://www.cnblogs.com/5201351/p/17378926.html

相关文章

  • 关于Kubernetes-v1.23.6-初始化时报错[WARNING FileExisting-tc]: tc not found in sy
    今天笔者在部署Kubernetes-v1.23.6版本时,在对master节点使用如下命令进行初始化时,报错:[WARNINGFileExisting-tc]:tcnotfoundinsystempath当然其实也从字符意义上来看,只能算是WARNING提醒,不会影响主要的功能和结果,但既然有这个提醒,就可能就在某些地方是有轻微影响的,为了......
  • kubernetes|EFK日志系统
    前言对于任何基础设施或后端服务系统,日志都是极其重要的,借助日志可以分析程序的运行状态、用户的操作行为等。最早常说的日志监控系统是ELK,即ElasticSearch(负责数据检索)、Logstash(负责数据收集)、Kibana(负责数据展示)三个软件的组合,随着技术的发展,又出现了很多新的名词,比如EFK,......
  • kubernetes域名解析服务CoreDNS
    k8sdns组件历史简介kubernetes的DNS组件历史有三个,分别是skydns、kube-dns和coredns;在k8s1.3版本之前使用的是skydns,之后的版本到1.17及之间的版本都是使用的kube-dns,1.18开始至今主要使用coredns;这些dns组件在k8s当中,主要作用就是解析k8s中servicename所对应的IP地......
  • 使用 External Secrets Operator 管理 Kubernetes 的 Secret
    Kubernetes的Secret机制允许我们将敏感信息存储中央存储库etcd中,这是一种比在Pod定义或容器镜像中存储信息更安全的方式。然而,Kubernetes目前还没有能力管理Secret的生命周期,所以有时候我们需要使用外部系统来管理这些敏感信息。随着我们需要管理的Secret数量的增长,我......
  • 部署Kubernetes遇到的问题与解决方法(初始化等)
    Kubelet和controlplane版本不对应:[ERRORKubeletVersion]:thekubeletversionishigherthanthecontrolplaneversion.Thisisnotasupportedversionskewandmayleadtoamalfunctionalcluster.Kubeletversion:"1.19.4"Controlplaneversion:&qu......
  • Kubernetes资源对象管理
    API对象:也就是K8S的资源对象,是K8S集群中的管理操作单元。K8S集群系统每支持一项新功能,引入一项新技术,一定会新引入对应的API对象,支持对该功能的管理操作。一、Kubernetes资源对象查询1.1查询资源类型#列出当前集群中所有的资源类型kubectlapi-resources   字段说明NAME:资......
  • k8s Kubernetes Dashboard 安装与使用
    https://github.com/kubernetes/dashboardhttps://developer.aliyun.com/article/745086https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.mdhttps://kubernetes.io/zh-cn/docs/tasks/access-application-cluster/web-ui-......
  • DevOps 基于Rancher 2.3 Kubernetes 1.16
    一服务器清单 二初始化服务器:安装Docker Docke-compose以及配置Docker阿里云镜像加速此处略过三 192.168.117.104安装RancherServerdockerrun-d--restart=unless-stopped\-p8080:80-p8443:443\-eCATTLE_SYSTEM_CATALOG=bundled\-eAUDIT_LEVEL=3\ranc......
  • linux-kubernetes(二进制部署)
    参考笔记:https://www.cnblogs.com/yinzhengjie/p/17069566.html一、环境准备准备5台机器,二进制部署K8S高可用集群:主机ipk8s-master0110.0.0.201k8s-master0210.0.0.202k8s-master0310.0.0.203k8s-node0110.0.0.204k8s-node0210.0.0.205二、K8S......
  • kubernetes入门
    一.导言随着容器技术的发展,软件界对容器管理的需求越来越迫切,于是出现了一些kubernetes(即k8s),dockerswarm等容器管理软件。同时k8s等服务编排软件也让微服务变得可行,快速扩容缩容,自动处理网络配置等特性也让k8s如火如荼。k8s能做什么?服务发现和负载均衡,使用dns或者ip对外暴露......