Loading

kubernetes下kubelet无法启动

错误如下:

09:58:45 kubernetes-node01 kubelet[6248]: F0124 09:58:45.902571    6248 server.go:265] failed to run Kubelet: misconfiguration: kubelet cgroup driver: "cgroupfs" is different from docker cgroup driver: "systemd"

1.docker info查看容器引擎是Systemd

root@kubernetes-master01:~# docker info
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: systemd

2.kubelet的引擎是Cgroup,需修改与Docker保持一致,修改kubelet的配置文件。修改CgroupDriver为Systemd

root@kubernetes-master01:/var/lib/kubelet# pwd
/var/lib/kubelet
root@kubernetes-master01:~# vim config.yaml
cgroupDriver: systemd

3.重启kubelet,服务已正常

root@kubernetes-master01:~#  systemctl restart kubelet
root@kubernetes-master01:~#  systemctl status kubelet
posted @ 2022-01-24 10:45  梨花海棠  阅读(485)  评论(0编辑  收藏  举报