kubernetes 集群搭建好后 node 一直处于 NotReady 状态

kubernetes 集群搭建好后 node 一直处于 NotReady 状态

1. 问题描述

kubectl  get node
NAME                      STATUS     ROLES    AGE   VERSION
izm5e3cntl0pztm4dj3phrz   NotReady   master   69s   v1.15.4

根据 kubelet 状态可以看到应该是 cni 网络插件没有安装

service  kubelet status
● kubelet.service - kubelet: The Kubernetes Node Agent
   Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/kubelet.service.d
           └─10-kubeadm.conf
   Active: active (running) since Mon 2019-10-28 14:40:53 CST; 2min 37s ago
     Docs: https://kubernetes.io/docs/home/
 Main PID: 9687 (kubelet)
    Tasks: 21 (limit: 4915)
   CGroup: /system.slice/kubelet.service
           └─9687 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --cgroup-driver=systemd --network-p

Oct 28 14:43:13 iZm5e3cntl0pztm4dj3phrZ kubelet[9687]: E1028 14:43:13.883502    9687 kubelet.go:2173] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network p
Oct 28 14:43:18 iZm5e3cntl0pztm4dj3phrZ kubelet[9687]: W1028 14:43:18.363536    9687 cni.go:213] Unable to update cni config: No networks found in /etc/cni/net.d
Oct 28 14:43:18 iZm5e3cntl0pztm4dj3phrZ kubelet[9687]: E1028 14:43:18.884847    9687 kubelet.go:2173] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network p
Oct 28 14:43:23 iZm5e3cntl0pztm4dj3phrZ kubelet[9687]: W1028 14:43:23.363828    9687 cni.go:213] Unable to update cni config: No networks found in /etc/cni/net.d
Oct 28 14:43:23 iZm5e3cntl0pztm4dj3phrZ kubelet[9687]: E1028 14:43:23.886093    9687 kubelet.go:2173] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network p
Oct 28 14:43:28 iZm5e3cntl0pztm4dj3phrZ kubelet[9687]: W1028 14:43:28.364040    9687 cni.go:213] Unable to update cni config: No networks found in /etc/cni/net.d
Oct 28 14:43:28 iZm5e3cntl0pztm4dj3phrZ kubelet[9687]: E1028 14:43:28.887429    9687 kubelet.go:2173] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network p
Oct 28 14:43:29 iZm5e3cntl0pztm4dj3phrZ kubelet[9687]: W1028 14:43:29.705262    9687 watcher.go:87] Error while processing event ("/sys/fs/cgroup/devices/libcontainer_11383_systemd_test_default.slice": 0x40000100
Oct 28 14:43:29 iZm5e3cntl0pztm4dj3phrZ kubelet[9687]: W1028 14:43:29.798080    9687 watcher.go:87] Error while processing event ("/sys/fs/cgroup/memory/libcontainer_11420_systemd_test_default.slice": 0x40000100 
Oct 28 14:43:29 iZm5e3cntl0pztm4dj3phrZ kubelet[9687]: W1028 14:43:29.798138    9687 watcher.go:87

2. 解决方法

安装flannel,也可以安装其他的网络插件

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

你可能感兴趣的:(kubernetes)