k8s:[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from di

[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 127.0.0.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 127.0.0.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 127.0.0.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 127.0.0.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 127.0.0.1:10248: connect: connection refused.

以上k8s 错误使用与 比较新的版本 1.19-1.22 都会在k8s初始化的时候卡在这里
这是我的初始化:
kubeadm init --kubernetes-version=v1.22.2 --image-repository registry.aliyuncs.com/google_containers --pod-network-cidr=10.244.0.0/16 --service-cidr=10.96.0.0/12 --ignore-preflight-errors=Swap

新建vim /etc/docker/daemon.json
因为这个文件是没有所以需要新建

{
  "exec-opts": ["native.cgroupdriver=systemd"]
}
···
然后重启服务

systemctl daemon-reload
systemctl restart docker

修改kubelet配置
修改kubelet的配置文件
10-kubeadm.conf 不一定在以下路径,可以运行 
systemctl  status kubelet 查看
新建/etc/systemd/system/kubelet.service.d/10-kubeadm.conf文件,并添加以下内容。
···
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --cgroup-driver=cgroupfs"
···
重启kubelet

systemctl daemon-reload
systemctl restart kubelet

因为k8s 说不在支持docker了,估计1.18版本开始有报警

[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/


所以,需要开启兼容模式。
在然后k8s 放弃docker兼容,后续如何走,走一步看一步了。
  • 6
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
根据您提供的信息,kubeadm正在创建kube-scheduler的静态Pod清单,并在"/etc/kubernetes/manifests"目录下创建本地etcd的静态Pod清单。 然后,kubeadm等待kubelet以静态Pod的形式从"/etc/kubernetes/manifests"目录启动控制平面。这个过程可能需要最多4分钟。 但是,在等待过程中,出现了一些问题。警告信息"W0225 17:09:39.827262 43878 manifests.go:214] the default kube-apiserver authorization-mode is "Node,RBAC"; using "Node,RBAC""和"W0225 17:09:39.827977 43878 manifests.go:214] the default kube-apiserver authorization-mode is "Node,RBAC"; using "Node,RBAC""表示默认的kube-apiserver授权模式为"Node,RBAC",并且将使用此模式。 警告信息"[kubelet-check] Initial timeout of 40s passed."和"[kubelet-check] It seems like the kubelet isn't running or healthy."表示在初始超时时间内无法连接到kubelet,可能是kubelet未运行或出现了健康问题。 警告信息"[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get http://localhost:10248/healthz: dial tcp 127.0.0.1:10248: connect: connection refused."表示尝试通过HTTP请求检查kubelet的健康状态失败,连接被拒绝。 这些警告表明kubelet可能在启动过程中遇到了问题。您可以检查kubelet的日志以获取更多详细信息,可能需要查看kubelet的日志文件以确定具体的问题所在。 如果您需要进一步的帮助,请提供更多信息或具体的错误日志,以便我们能够更好地帮助您解决问题。
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值