问题原文
原帖链接 · Antoine · CC BY-SA 4.0
I run a kubernetes cluster, installed with kubeadm. I recently upgraded from 1.19 to 1.20 and migrated the container runtime from docker to containerd, since docker is now deprecated.
I configured containerd and kubelet to use it, and uninstalled docker from all nodes. Everything seems to be running fine.
Today, I tried to upgrade from 1.20 to 1.21 but I got two warnings when running kubeadm upgrade plan which make me think the containerd transition was not complete:
It tries to use docker:
cannot automatically set CgroupDriver when starting the Kubelet: cannot execute 'docker info -f {{.CgroupDriver}}': executable file not found in $PATH- I probably have a configuration issue because
kubeadmseems to not be aware that we don't use docker anymore, but I haven't found the right option in the documentation or local conf, except--cri-socketwhich doesn't work withkubeadm upgrade. - Second, the wording is strange: "when starting the Kubelet". But my kubelet is starting just fine, doesn't complain about missing docker or CgroupDriver.
- I probably have a configuration issue because
It doesn't detect the cgroup driver setting:
The 'cgroupDriver' value in the KubeletConfiguration is empty. Starting from 1.22, 'kubeadm upgrade' will default an empty value to the 'systemd' cgroup driver. The cgroup driver between the container runtime and the kubelet must match!This is really surprising because I have
cgroupDriver: systemdinkubectl -n kube-system get cm kubelet-config-1.20 -o yaml, in/var/lib/kubelet/config.yaml, also the flag in/etc/default/kubeletand/var/lib/kubelet/kubeadm-flags.env, and it is even printed bykubeadm --v=10!
How can I find out if there is an underlying configuration issue, or is I can safely ignore these warnings ?
I'm not sure what files, configmap or logs may be useful to help me solve this, but I will gladly provide them if needed.
已采纳解答
原帖链接 · Antoine · CC BY-SA 4.0
Although this was downvoted, in the event that someone has the same issue and feels as lost as I was, I hope google will lead you here :)
kubeadmwas trying to usedockerbased on the node's configuration and not the kubelet's configuration, and I didn't change the nodes' config when migrating tocontainerd(as I was not aware it was set at that level). Fix with:kubectl annotate node $node --overwrite kubeadm.alpha.kubernetes.io/cri-socket=unix:///run/containerd/containerd.sockfor each node. Found this here
The
cgroupDriverwarning is a bug inkubeadmthat probably won't be fixed because the whole check is going away soon. So it can be ignored (if your kubelet's conf really sets the cgrouDriver).
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
