日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

故障error: failed to run Kubelet: failed to create kubelet: misconfiguration: kubelet cgroup driver: “

發布時間:2025/3/11 编程问答 72 豆豆
生活随笔 收集整理的這篇文章主要介紹了 故障error: failed to run Kubelet: failed to create kubelet: misconfiguration: kubelet cgroup driver: “ 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

環境:

? ? docker:18.09.9

? ? kubernetes:1.17

錯誤信息:

error: failed to run Kubelet: failed to create kubelet: misconfiguration:?kubelet cgroup driver: "cgroupfs" is different from docker cgroup driver: "systemd"?

錯誤原因:

? ? docker和k8s使用的cgroup不一致導致

解決辦法:

? ? 修改二者一致,統一使用systemd或者cgroupfs進行資源管理。由于k8s官方文檔中提示使用cgroupfs管理docker和k8s資源,而使用systemd管理節點上其他進程資源在資源壓力大時會出現不穩定,因此推薦修改docker和k8s統一使用systemd管理資源。

Cgroup drivers

When systemd is chosen as the init system for a Linux distribution, the init process generates and consumes a root control group (cgroup) and acts as a cgroup manager. Systemd has a tight integration with cgroups and will allocate cgroups per process. It’s possible to configure your container runtime and the kubelet to use?cgroupfs. Using?cgroupfs?alongside systemd means that there will then be two different cgroup managers.

Control groups are used to constrain resources that are allocated to processes. A single cgroup manager will simplify the view of what resources are being allocated and will by default have a more consistent view of the available and in-use resources. When we have two managers we end up with two views of those resources. We have seen cases in the field where nodes that are configured to use?cgroupfs?for the kubelet and Docker, and?systemd?for the rest of the processes running on the node becomes unstable under resource pressure.

docker修改方法:

? ? 在

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

k8s修改方法:? ??

在 Master 節點上配置 kubelet 所需的 cgroup 驅動

使用 Docker 時,kubeadm 會自動為其檢測 cgroup 驅動在運行時對?/var/lib/kubelet/kubeadm-flags.env?文件進行配置。 如果您使用了不同的 CRI, 您得把?/etc/default/kubelet?文件中的?cgroup-driver?位置改為對應的值,像這樣:

KUBELET_EXTRA_ARGS=--cgroup-driver=<value>

這個文件將會被?kubeadm init?和?kubeadm join?用于為 kubelet 獲取 額外的用戶參數。

需要重啟 kubelet:

systemctl daemon-reloadsystemctl restart kubelet

總結

以上是生活随笔為你收集整理的故障error: failed to run Kubelet: failed to create kubelet: misconfiguration: kubelet cgroup driver: “的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。