kubelet 启动失败
错误日志
Jun 29 16:05:19 master0 kubelet[29613]: E0629 16:05:19.744377 29613 node_container_manager_linux.go:61] "Failed to create cgroup" err="Cannot set property TasksAccounting, or unknown property." cgroupName=[kubepods]
Jun 29 16:05:19 master0 kubelet[29613]: E0629 16:05:19.744410 29613 kubelet.go:1466] "Failed to start ContainerManager" err="Cannot set property TasksAccounting, or unknown property."
问题定位
检查容器运行时和kubelet是否使用了相同的cgroup driver
命令:cat /var/lib/kubelet/config.yaml 和 docker info
结论:一致的
检查systemd 版本
[root@master0 ~]# rpm -q systemd
systemd-219-30.el7_3.6.x86_64
低版本systemd导致的 failed to set TasksAccounting
In runc, there is a piece of code which try to set property
TasksAccounting=true
on kubepods.slice. With219-30.el7_3.9
, I triedsystemctl set-property kubepods.slice TasksAccounting=yes
and create/run/systemd/system/kubepods.slice.d/50-TasksAccounting.conf
, but these approaches failed to setTasksAccounting
. With219-62.el7_6.9
, it works well.BTW, in the systemd official change logs,
TasksAccounting
is introduced in systemd 227, confusing.