k8s节点nodReady,CNI 网络插件问题

1.k8s集群安装后节点notReady

现象:
在这里插入图片描述
执行命令查看问题:
1. kubectl describe node maste
在这里插入图片描述
2.journalctl -f -u kubelet
在这里插入图片描述

错误信息:

5月 18 10:12:30 master kubelet[1458]: E0518 10:12:30.373650    1458 kubelet.go:2386] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized"
5月 18 10:12:31 master kubelet[1458]: I0518 10:12:31.649374    1458 cni.go:240] "Unable to update cni config" err="no networks found in /etc/cni/net.d"
#################################
Conditions:
  Type             Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
  ----             ------  -----------------                 ------------------                ------                       -------
  MemoryPressure   False   Thu, 18 May 2023 10:35:34 +0800   Tue, 25 Apr 2023 18:49:53 +0800   KubeletHasSufficientMemory   kubelet has sufficient memory available
  DiskPressure     False   Thu, 18 May 2023 10:35:34 +0800   Tue, 25 Apr 2023 18:49:53 +0800   KubeletHasNoDiskPressure     kubelet has no disk pressure
  PIDPressure      False   Thu, 18 May 2023 10:35:34 +0800   Tue, 25 Apr 2023 18:49:53 +0800   KubeletHasSufficientPID      kubelet has sufficient PID available
  Ready            False   Thu, 18 May 2023 10:35:34 +0800   Tue, 25 Apr 2023 18:49:53 +0800   KubeletNotReady              container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Addresses:
  InternalIP:  192.168.145.128

2.解决方法

重新安装部署 CNI 网络插件 flannel

# 安装插件
[root@master hqm]# kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
namespace/kube-flannel created
clusterrole.rbac.authorization.k8s.io/flannel created
clusterrolebinding.rbac.authorization.k8s.io/flannel created
serviceaccount/flannel created
configmap/kube-flannel-cfg created
daemonset.apps/kube-flannel-ds created

# 重启 docker 和 kubelet
[root@master hqm]# systemctl restart docker && systemctl restart kubelet

# 等待一会,成功运行 coredns,节点变为 ready 状态。
[root@master hqm]# kubectl get pod -n kube-system
NAME                             READY   STATUS    RESTARTS      AGE
coredns-6d8c4cb4d-ddmqf          1/1     Running   0             3h8m
coredns-6d8c4cb4d-j6swz          1/1     Running   0             3h8m
etcd-master                      1/1     Running   7 (40s ago)   22d
kube-apiserver-master            1/1     Running   6 (30s ago)   22d
kube-controller-manager-master   1/1     Running   6 (40s ago)   22d
kube-proxy-q8m5t                 1/1     Running   7 (29s ago)   22d
kube-scheduler-master            1/1     Running   7 (29s ago)   22d
[root@master hqm]# kubectl get nodes
NAME     STATUS   ROLES                       AGE   VERSION
master   Ready    control-plane,master,node   22d   v1.23.7
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值