How to Solve kubelet starts error after k8s Cluster is Restarted
After the k8s cluster restarts, kubelet starts to solve the error
1 k8s version 1.23.0, docker CE version 20.10.14
2. An error is reported for the problem, and an error is reported for starting kubelet. The contents are as follows:
May 16 09:47:13 k8s-master kubelet: E0516 09:47:13.512956 7403 server.go:302] "Failed to run kubelet" err="failed to run Kubelet: misconfiguration: kubelet cgroup driver: \"systemd\" is different from docker cgroup driver: \"cgroupfs\""
May 16 09:47:13 k8s-master systemd: kubelet.service: main process exited, code=exited, status=1/FAILURE
May 16 09:47:13 k8s-master systemd: Unit kubelet.service entered failed state.
May 16 09:47:13 k8s-master systemd: kubelet.service failed
3 problem analysis: according to the error report, the reason should be that kubelet’s cgroups are inconsistent with docker
4. Solve the problem and modify the docker configuration
cat > /etc/docker/daemon.json <<EOF
{"exec-opts": ["native.cgroupdriver=systemd"]}
EOF
5. Restart docker to solve the problem
[root@k8s-master ~]# systemctl restart docker
[root@k8s-master ~]# systemctl restart kubelet
[root@k8s-master ~]#
[root@k8s-master ~]# systemctl status kubelet
● kubelet.service - kubelet: The Kubernetes Node Agent
Loaded: loaded (/usr/lib/systemd/system/kubelet.service; enabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/kubelet.service.d
└─10-kubeadm.conf
Active: active (running) since Mon 2022-05-16 09:48:06 CST; 3s ago
Docs: https://kubernetes.io/docs/
Main PID: 8226 (kubelet)
Tasks: 23
Memory: 56.9M
CGroup: /system.slice/kubelet.service
├─8226 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config...
└─8745 /opt/cni/bin/calico
Read More:
- [Solved] “Failed to run kubelet“ err=“failed to run Kubelet: misconfiguration: kubelet cgroup driver: \“cgrou
- [Solved] K8s cluster build error: error: kubectl get csr No resources found.
- [Solved] Upstream connect error or disconnect occurs after the k8s istio virtual machine is restarted
- [Solved] k8s kubeadmin init Error: http://localhost:10248/healthz‘ failed
- How to Solve k8s Nodal issues: /sys/fs/cgroup/memory/docker: no space left on device\““: unknown.
- K8s cluster initialization error: Port 6443 is in use [Solved]
- [Solved] K8s Initialize Error: failed with error: Get “http://localhost:10248/healthz“
- [Solved] Ubuntu 20.04 LTS Install k8s Error: The connection to the server localhost:8080 was refused
- Node Kubelet Error: node “xxxxx“ not found [How to Solve]
- K8s Install Error: Error: unknown flag: –experimental-upload-certs
- How to Solve Redis Cluster Build Error
- K8S Master Initialize Error: [ERROR CRI]: container runtime is not running: output: E0812
- [Solved] K8s Error: ERROR: Unable to access datastore to query node configuration
- How to Solve Redis Cluster Error: (Error) Moved
- K8s initializing the master & worker node error [How to Solve]
- K8s ❉ Error: cannot be handled as a** [How to Solve]
- How to Solve Docker Error: elasticsearch exception: type=cluster_block_exception, reason=blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];
- How to Solve creating bean with name ‘mappingjackson2httpmessageconverter’ error when elasticsearch advanced client starts‘
- [Solved] k8s Error: Back-off restarting failed container
- [Solved] kubelet Startup Error: cannot find network namespace for the terminated container