kubeadm: BUG REPORT:kubelet cgroup driver
BUG REPORT
Versions
kubeadm version:1.9.0-00 amd64 kubelet version:1.9.0-00 amd64 kubernetes-cni:0.6.0-00 amd64 docker-ce version:17.12.0~ce-0~ubuntu amd64 system version:Ubuntu 16.04.3 LTS Physical machine
Problems
install kubernetes cluster on ubuntu 16.04. When running kubeadm init,there is an error: [init] This might take a minute or longer if the control plane images have to be pulled. [kubelet-check] It seems like the kubelet isn’t running or healthy. [kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10255/healthz’ failed with error: Get http://localhost:10255/healthz: dial tcp [::1]:10255: getsockopt: connection refused. [kubelet-check] It seems like the kubelet isn’t running or healthy. [kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10255/healthz’ failed with error: Get http://localhost:10255/healthz: dial tcp [::1]:10255: getsockopt: connection refused. [kubelet-check] It seems like the kubelet isn’t running or healthy. [kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10255/healthz’ failed with error: Get http://localhost:10255/healthz: dial tcp [::1]:10255: getsockopt: connection refused. [kubelet-check] It seems like the kubelet isn’t running or healthy. [kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10255/healthz/syncloop’ failed with error: Get http://localhost:10255/healthz/syncloop: dial tcp [::1]:10255: getsockopt: connection refused. [kubelet-check] It seems like the kubelet isn’t running or healthy. [kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10255/healthz/syncloop’ failed with error: Get http://localhost:10255/healthz/syncloop: dial tcp [::1]:10255: getsockopt: connection refused. [kubelet-check] It seems like the kubelet isn’t running or healthy. [kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10255/healthz/syncloop’ failed with error: Get http://localhost:10255/healthz/syncloop: dial tcp [::1]:10255: getsockopt: connection refused. [kubelet-check] It seems like the kubelet isn’t running or healthy.
After i saw the syslog /var/log/syslog, got errors as follow: Jan 04 16:20:58 master03 kubelet[10360]: W0104 16:20:58.268285 10360 cni.go:171] Unable to update cni config: No networks found in /etc/cni/net.d Jan 04 16:20:58 master03 kubelet[10360]: W0104 16:20:58.269487 10360 cni.go:171] Unable to update cni config: No networks found in /etc/cni/net.d Jan 04 16:20:58 master03 kubelet[10360]: I0104 16:20:58.269527 10360 docker_service.go:232] Docker cri networking managed by cni Jan 04 16:20:58 master03 kubelet[10360]: I0104 16:20:58.274386 10360 docker_service.go:237] Docker Info: &{ID:3XXZ:XEDW:ZDQS:A2MI:5AEN:CFEP:44AQ:YDS4:CRME:UBRS:46LI:MXNS Containers:0 ContainersRunning:0 Cont Jan 04 16:20:58 master03 kubelet[10360]: error: failed to run Kubelet: failed to create kubelet: misconfiguration: kubelet cgroup driver: “cgroupfs” is different from docker cgroup driver: “systemd”
And i checked docker cgroup driver: docker info |grep -i cgroup Cgroup Driver: systemd
Versions
kubeadm version (use kubeadm version):
Environment:
- Kubernetes version (use
kubectl version): - Cloud provider or hardware configuration:
- OS (e.g. from /etc/os-release):
- Kernel (e.g.
uname -a): - Others:
What happened?
What you expected to happen?
How to reproduce it (as minimally and precisely as possible)?
Anything else we need to know?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 43 (11 by maintainers)
I hit this same issue with kubeadm
v1.9.2but I can see kubelet is configured to use systemd cgroup driver.kubelet is using --cgroup-driver=systemd
docker info | grep -i cgroup
kubelet logs
Version Info:
I propose to close this issue
I’ve observed 2 reasons that cause most of the reports here:
forgetting to run ‘systemctl daemon-reload’ after editing systemd drop-ins. Eventhough -cgroup-driver=systemd was added to /etc/systemd/system/kubelet.service.d/10-kubeadm.conf it didn’t make any effect and default(or previously specified with --cgroup-driver) driver was used.
running ‘kubelet logs’ command to see kubelet logs. ‘logs’ subcommand doesn’t exist in kubelet, so ‘kubelet logs’ and ‘kubelet’ are the same commands. ‘kubelet logs’ runs kubelet with the default cgroup driver ‘cgroupfs’ and kubelet complains about inconsistency between kubelet and docker drivers. ‘journalctl -ux kubelet’ should be used to see the logs.
I tested --cgroup-driver=systemd option with kubelet 1.8.0, 1.9.0, 1.9.3 and 1.9.5. There were no error messages “cgroupfs is different from docker cgroup driver: systemd” in the logs.
@FrostyLeaf Thank you! I could reproduce this as well. Seems to be a bug. Looking at it.
As a temporary workaround you can switch docker and kubelet to cgroupfs driver. It should work.
I can confirm this.
@lavender2020 You need to manually append
--cgroup-driver=systemdtokubeletstartup args and reload kubelet unit file to restart the service.The default driver that the
kubeletuses to manipulate cgroups on the host iscgroupfs.this is still happening, nothing worked!
I do think it’s a bug. I checked the docker version and kubeadm file, of course the kubeadm script does that check too. however i get the mismatch err msg. If someone ever read carefully you can see some of above has the issue AFTER correctly set the parameter.
@dragosrosculete
we are improving our troubleshooting docs, but also in 1.11 and later the cgroup driver for docker should be automatically matched by kubeadm.
I had this same problem on Ubuntu 16.04, Kube version v1.10.4 . Docker version 1.13.1 Docker was starting with native.cgroupdriver=systemd . This config was set by me in /etc/docker/daemon.json
I have modified the config in /etc/systemd/system/kubelet.service.d/10-kubeadm.conf Added a new line:
Environment="KUBELET_CGROUP_ARGS=--cgroup-driver=systemd"And add the parameter$KUBELET_CGROUP_ARGSin ExecStartThen did a systemctl daemon-reload and service kubelet restart . Kubelet started correctly .
IMO this is a configuration mismatch between
dockerandkubelet, rather than a bug.Before running
kubeadm init, a prerequisite check on cgroup driver should be done.