gpt4 book ai didi

linux - kubelet 失败,kubelet cgroup 驱动程序 : "cgroupfs" is different from docker cgroup driver: "systemd"

转载 作者:IT王子 更新时间:2023-10-29 01:07:27 32 4
gpt4 key购买 nike

cgroup driver的配置在/etc/systemd/system/kubelet.service.d/10-kubeadm.conf

Environment="KUBELET_CGROUP_ARGS=--cgroup-driver=systemd"

我还用 cli 检查了 Environment

$ systemctl show --property=Environment kubelet | cat
Environment=KUBELET_KUBECONFIG_ARGS=--kubeconfig=/etc/kubernetes/kubelet.conf\x20--require-kubeconfig=true KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests\x20--allow-privileged=true KUBELET_NETWORK_ARGS=--network-plugin=cni\x20--cni-conf-dir=/etc/cni/net.d\x20--cni-bin-dir=/opt/cni/bin KUBELET_DNS_ARGS=--cluster-dns=10.96.0.10\x20--cluster-domain=cluster.local KUBELET_AUTHZ_ARGS=--authorization-mode=Webhook\x20--client-ca-file=/etc/kubernetes/pki/ca.crt KUBELET_CADVISOR_ARGS=--cadvisor-port=0 KUBELET_CGROUP_ARGS=--cgroup-driver=systemd

KUBELET_CGROUP_ARGS=--cgroup-driver=systemd

如何复制它:

  • yum install -y docker-1.12.6
  • systemctl 启用 docker && systemctl 启动 docker
  • 设置强制 0
  • yum install -y kubelet kubeadm
  • systemctl 启用 kubelet && systemctl 启动 kubelet
  • systemctl 守护进程-重新加载
  • systemctl 重启 kubelet
  • kubelet 日志

环境:

  • Kubernetes版本(使用kubectl版本):1.7.3
  • 云提供商或硬件配置**:4 核 16G RAM
  • 操作系统(例如来自/etc/os-release):CentOS Linux 7(核心)
  • 内核(例如 uname -a):Linux 10-8-108-92 3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 23 17:05:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  • 安装工具:kubeadm

最佳答案

在我的环境中,它只能以相反的方式工作。设置 systemd 总是会导致错误。这是我当前的设置

OS: CentOS 7.6.1810 
Minikube Version v1.0.0
Docker Version 18.06.2-ce

我的解决方案是:检查 /etc/docker/daemon.json 并将 systemd 更改为 cgroupfs

{
"exec-opts": ["native.cgroupdriver=cgroupfs"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true"
]
}

然后重新加载systemctl systemctl daemon-reload杀死之前的 minikub 配置 minikube delete并再次启动 minikube minikube start --vm-driver=none

现在检查命令行输出应该在两个输出中找到 cgroupfs

docker info | grep -i cgroup
cat /etc/systemd/system/kubelet.service.d/10-kubeadm.conf

最后你应该看到

   kubectl is now configured to use "minikube"
= Done! Thank you for using minikube!

简单的解决方案:使用额外的配置参数启动你的 minikube

--extra-config=kubelet.cgroup-driver=systemd

下一行是启动minikube的完整命令

minikube start --vm-driver=none --extra-config=kubelet.cgroup-driver=systemd

祝一切顺利

关于linux - kubelet 失败,kubelet cgroup 驱动程序 : "cgroupfs" is different from docker cgroup driver: "systemd",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45708175/

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