目录
常见问题一,error: failed to run Kubelet: failed to create kubelet: misconfiguration: kubelet cgroup driver: “systemd” is different from docker cgroup driver: “cgroupfs”
常见问题二、error: “Failed to load kubelet config file” err=“failed to load Kubelet config file /var/lib/kubelet/config.yaml”
常见问题一,error: failed to run Kubelet: failed to create kubelet: misconfiguration: kubelet cgroup driver: “systemd” is different from docker cgroup driver: “cgroupfs”
解决过程:
1、查看服务状态,发现kubelet服务不正常运行
systemctl status kubelet
2、查看具体报错
journalctl -u kubelet.service
报错信息如下:
error: failed to run Kubelet: failed to create kubelet: misconfiguration: kubelet cgroup driver: “systemd” is different from docker cgroup driver: “cgroupfs”
解决过程
# Step 1 : 问题的判断
# 输出 Group 类型 : docker info | grep "Cgroup Driver"
# Step 2 : 重置 kubeadm配置
kubeadm reset
# 或者使用 echo y | kubead reset
# Step 3 : 修改 Docker
vim /etc/docker/daemon.json
# 添加 "exec-opts": ["native.cgroupdriver=systemd"]
# PS : 没有可以直接创建 , 最终效果如下
{
"exec-opts":["native.cgroupdriver=systemd"]
}
# Step 4 : 重启服务
systemctl daemon-reload
systemctl restart docker
systemctl restart kubelet
# Step 5 : 校验结果 , 应该输出为 systemd
docker info | grep "Cgroup Driver"
# 补充 :
kubelet 的配置文件 : /var/lib/kubelet/kubeadm-flags.env
关键信息
修改docker cgroup驱动
cat > /etc/docker/daemon.json <<EOF
{"exec-opts": ["native.cgroupdriver=systemd"]}
EOF
常见问题二、error: “Failed to load kubelet config file” err=“failed to load Kubelet config file /var/lib/kubelet/config.yaml”
解决方法:文章来源:https://www.toymoban.com/news/detail-516671.html
kubeadm init --image-repository registry.cn-hangzhou.aliyuncs.com/google_containers
文章来源地址https://www.toymoban.com/news/detail-516671.html
到了这里,关于Centos7下Kubernets kubeadm方式安装常见问题(一)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!