最近在部署kebeedge,需要先在云服上部署k8s,期间通过kubeadm init --config的方式进行master的部署,记录一下遇到的kubelet相关的错误

在通过kubeadm init --config启动master时遇到如下报错提示:

 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'

参考这个 issues,解决方案为在kubeadm-init.yaml文件中添加以下内容:

kubernetesVersion: 1.22.12
networking:
  dnsDomain: cluster.local
  serviceSubnet: 10.96.0.0/12
  podSubnet: 10.244.0.0/16
scheduler: {}
---
kind: KubeletConfiguration
apiVersion: kubelet.config.k8s.io/v1beta1
#cgroupDriver: systemd
cgroupDriver: cgroupfs

然后重新kubeadm reset,重新init即可!

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐