安裝kubernetes遇到 cni config uninitialized
KubeletNotReady runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitializeddocker
緣由:
由於kubelet配置了network-plugin=cni,可是還沒安裝,因此狀態會是NotReady,不想看這個報錯或者不須要網絡,就能夠修改kubelet配置文件,去掉network-plugin=cni 就能夠了。api
解決方法:網絡
vi /etc/systemd/system/kubelet.service.d/10-kubeadm.confserver
刪除最後一行裏的$KUBELET_NETWORK_ARGS
1.11.2版本的封裝在/var/lib/kubelet/kubeadm-flags.env文件中token
使用命令:
[root@k8s ~]# cat /var/lib/kubelet/kubeadm-flags.env
KUBELET_KUBEADM_ARGS=--cgroup-driver=systemd --cni-bin-dir=/opt/cni/bin --cni-conf-dir=/etc/cni/net.d --network-plugin=cnici
重啓kubelet:
systemctl enable kubelet && systemctl start kubeletkubernetes
從新初始化:
kubeadm reset
kubeadm init --kubernetes-version=v1.11.2 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.11.90 --token-ttl 0it