gpt4 book ai didi

kubernetes - Kubeadm 初始化问题

转载 作者:行者123 更新时间:2023-12-02 02:49:44 27 4
gpt4 key购买 nike

Kubeadm 初始化问题。

配置数据版本:

os -rhel7.5
env -onprem server
docker - 19
kube - 18

控制台输出:

[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.

出了什么问题以及如何解决?

最佳答案

根据您提供的信息,可以在此处执行几项操作。

首先可以检查docker原生的cgroupdriver和kubelet是否一致。您可以通过运行以下命令查看 kubelet 的配置:

cat /var/lib/kubelet/kubeadm-flags.env 

要检查 docker 配置,您可以简单地使用:

docker info | grep Cgroup

如果你需要改变它,你可以这样做:

cat << EOF > /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"]
}
EOF

要更改 kubelet cgroup 驱动程序,您必须:

`vi /etc/systemd/system/kubelet.service.d/10-kubeadm.conf`

并更新KUBELET_CGROUP_ARGS=--cgroup-driver=<systemd or cgroupfs>

第二种可能的解决方案可能是禁用交换。您可以使用以下命令来做到这一点:

sudo swapoff -a
sudo sed -i '/ swap / s/^/#/' /etc/fstab

之后重新启动机器,然后执行kubeadm reset并尝试使用 kubeadm init 初始化集群.

关于kubernetes - Kubeadm 初始化问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62216678/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com