Installation Kubernetes error: STATUS NotReady

After executing kubeadm init command, you want to look at operational status of all nodes, and found that all nodes is always in a state NotReady

$ sudo kubectl get nodes
NAME         STATUS     ROLES    AGE    VERSION
kube-node1   NotReady   master   174m   v1.13.3
kube-node2   NotReady   <none>   168m   v1.13.4
kube-node3   NotReady   <none>   167m   v1.13.3

View error log

$ sudo journalctl -f -u kubelet

-- Logs begin at 日 2019-03-17 14:18:29 CST. --
3月 21 22:31:50 kube-node1 kubelet[167130]: E0321 22:31:50.136580  167130 summary_sys_containers.go:47] Failed to get system container stats for "/system.slice/docker.service": failed to get cgroup stats for "/system.slice/docker.service": failed to get container info for "/system.slice/docker.service": unknown container "/system.slice/docker.service"
3月 21 22:31:50 kube-node1 kubelet[167130]: E0321 22:31:50.137336  167130 summary_sys_containers.go:47] Failed to get system container stats for "/system.slice/kubelet.service": failed to get cgroup stats for "/system.slice/kubelet.service": failed to get container info for "/system.slice/kubelet.service": unknown container "/system.slice/kubelet.service"
3月 21 22:31:53 kube-node1 kubelet[167130]: W0321 22:31:53.529945  167130 cni.go:203] Unable to update cni config: No networks found in /etc/cni/net.d
3月 21 22:31:53 kube-node1 kubelet[167130]: E0321 22:31:53.530035  167130 kubelet.go:2192] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
3月 21 22:31:58 kube-node1 kubelet[167130]: W0321 22:31:58.530693  167130 cni.go:203] Unable to update cni config: No networks found in /etc/cni/net.d
3月 21 22:31:58 kube-node1 kubelet[167130]: E0321 22:31:58.530794  167130 kubelet.go:2192] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
3月 21 22:32:00 kube-node1 kubelet[167130]: E0321 22:32:00.145152  167130 summary_sys_containers.go:47] Failed to get system container stats for "/system.slice/kubelet.service": failed to get cgroup stats for "/system.slice/kubelet.service": failed to get container info for "/system.slice/kubelet.service": unknown container "/system.slice/kubelet.service"

No networks in /etc/cni/net.d found from this line to see the error message, guess probably the network configuration issues, there may be a problem with the installation process Flannel.

Installation Flannel

sysctl net.bridge.bridge-nf-call-iptables=1
wget https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
#修改docker镜像地址
sed 's/quay.io\/coreos/registry.cn-beijing.aliyuncs.com\/imcto/g'
#安装flannel
sudo kubectl apply -f kube-flannel.yml

Check node status again

$ sudo kubectl get nodes
NAME         STATUS   ROLES    AGE     VERSION
kube-node1   Ready    master   3h57m   v1.13.3
kube-node2   Ready    <none>   3h51m   v1.13.4
kube-node3   Ready    <none>   3h50m   v1.13.3
Published 33 original articles · won praise 0 · Views 3940

Guess you like

Origin blog.csdn.net/erhaiou2008/article/details/103873088