锅炉信息网 > 锅炉知识 > 锅炉学习

k8s安装网络插件镜像下载不了问题

发布时间:

下面是本人在帮好友安装k8s过程中在安装网络插件这里碰到的问题使用kubectl apply -f kube-flannel.yml安装flannel网络插件安装

下面是本人在帮好友安装k8s过程中在安装网络插件这里碰到的问题

使用kubectl apply -f kube-flannel.yml安装flannel网络插件

安装完之后是要等个一阵子的,但是等了十分钟后发现节点状态还是为Noready

通过journalctl -f -u kubelet 查看kubelet日志发现报错

systemctl status kubelet 查看报错如下

# systemctl status kubeletn* kubelet.service - kubelet: The Kubernetes Node Agentn Loaded: loaded (/usr/lib/systemd/system/kubelet.service; disabled; vendor preset: disabled)n Drop-In: /usr/lib/systemd/system/kubelet.service.dn `-10-kubeadm.confn Active: active (running) since 2022-11-04 19:53:22 CST; 7s agon Docs: https://kubernetes.io/docs/n Main PID: 22607 (kubelet)n Tasks: 14n Memory: 32.7Mn CGroup: /system.slice/kubelet.servicen `-22607 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --network-plugin=cni...nn22607 kubelet.go:1742] "Failed creating a mirror pod for" err="pods "kube-apiserver-master" already exists" pod="kube-...server-master"n22607 kubelet.go:1742] "Failed creating a mirror pod for" err="pods "kube-controller-manager-master" already exists" p...anager-master"n22607 request.go:665] Waited for 1.041822653s due to client-side throttling, not priority and fairness, request: POST:ht...be-system/podsn22607 kubelet.go:1742] "Failed creating a mirror pod for" err="pods "kube-scheduler-master" already exists" pod="kube-...eduler-master"n22607 configmap.go:200] Couldn't get configMap kube-system/kube-proxy: failed to sync configmap cache: timed out waiting... the conditionn22607 nestedpendingoperations.go:335] Operation for "{volumeName:kubernetes.io/configmap/6839e60e-9e18-4b9a-90e5-bdbc860...215 +0800 CSTn22607 configmap.go:200] Couldn't get configMap kube-flannel/kube-flannel-cfg: failed to sync configmap cache: timed out ... the conditionn22607 nestedpendingoperations.go:335] Operation for "{volumeName:kubernetes.io/configmap/a075c2d0-52d0-4f92-a2db-8b79b5e...7888 +0800 CSTn22607 cni.go:240] "Unable to update cni config" err="no networks found in /etc/cni/net.d"n22607 kubelet.go:2391] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotRea...uninitialized"nHint: Some lines were ellipsized, use -l to show in full.

还是说报没有安装网络插件的问题。只能说明网络插件安装失败了

查看kube-flannel pod节点状态 Terminating

[root@master k8s]# kubectl get pod -n kube-flannelnNAME READY STATUS RESTARTS AGEnkube-flannel-ds-v8xw5 0/1 Terminating 0 33m

查看 kube-flannel 启动过程 看Events事件

[root@master k8s]# kubectl describe pod -n kube-flannelnnEvents:n Type Reason Age From Messagen ---- ------ ---- ---- -------n Normal Scheduled 42s default-scheduler Successfully assigned kube-flannel/kube-flannel-ds-z45kj to mastern Normal Pulled 42s kubelet Container image "docker.io/rancher/mirrored-flannelcni-flannel-cni-plugin:v1.1.0" already present on machinen Normal Created 42s kubelet Created container install-cni-pluginn Normal Started 42s kubelet Started container install-cni-pluginn Normal Pulling 41s kubelet Pulling image "docker.io/rancher/mirrored-flannelcni-flannel:v0.20.0"

发现在 pulling image "http://docker.io/rancher/mirrored-flannelcni-flannel:v0.20.0" 这个地方一直卡着。

原因是这是一个国外的镜像访问不了,有点慢。想办法替换其它可以下载的镜像

搜索一下

[root@master k8s]# docker search flannelnNAME DESCRIPTION STARS OFFICIAL AUTOMATEDnjmgao1983/flannel from quay.io/coreos/flannel 10 [OK]nlizhenliang/flannel 4neaszlab/flannel from quay.io/coreos/flannel 4nsigwindowstools/flannel 3nflannelcni/flannel primary images from https://github.com/flann… 2nwinjay/flannel 1nflannelcni/flannel-cni-plugin Flannel CNI plugin images as built from: htt… 1njasonbrooks/flannel flannel system container 1 [OK]

选择拉取一个 jmgao1983/flannel 与 lizhenliang/flannel 都行

docker pull jmgao1983/flannel

在线编辑 kube-flannel.yml

kubectl edit -f kube-flannel.yml

initContainers:n - name: install-cni-pluginn #image: flannelcni/flannel-cni-plugin:v1.1.0 for ppc64le and mips64le (dockerhub limitations may apply)n image: docker.io/rancher/mirrored-flannelcni-flannel-cni-plugin:v1.1.0n command:n - cpn args:n - -fn - /flanneln - /opt/cni/bin/flanneln volumeMounts:n - name: cni-pluginn mountPath: /opt/cni/binn - name: install-cnin #image: flannelcni/flannel:v0.20.0 for ppc64le and mips64le (dockerhub limitations may apply)n image: jmgao1983/flanneln command:n - cpn args:n - -fn - /etc/kube-flannel/cni-conf.jsonn - /etc/cni/net.d/10-flannel.conflistn volumeMounts:n - name: cnin mountPath: /etc/cni/net.dn - name: flannel-cfgn mountPath: /etc/kube-flannel/n containers:n - name: kube-flanneln #image: flannelcni/flannel:v0.20.0 for ppc64le and mips64le (dockerhub limitations may apply)n image: jmgao1983/flannel

将 http://docker.io/rancher/mirrored-flannelcni-flannel:v0.20.0 换成 jmgao1983/flannel

再次查看

kubectl describe pod -n kube-flannel

看到 Started container kube-flannel 表示启动成功

Events:n Type Reason Age From Messagen ---- ------ ---- ---- -------n Normal Scheduled 42s default-scheduler Successfully assigned kube-flannel/kube-flannel-ds-lg6th to mastern Normal Pulled 42s kubelet Container image "docker.io/rancher/mirrored-flannelcni-flannel-cni-plugin:v1.1.0" already present on machinen Normal Created 42s kubelet Created container install-cni-pluginn Normal Started 42s kubelet Started container install-cni-pluginn Normal Pulling 41s kubelet Pulling image "jmgao1983/flannel"n Normal Pulled 24s kubelet Successfully pulled image "jmgao1983/flannel" in 17.43224951sn Normal Created 24s kubelet Created container install-cnin Normal Started 24s kubelet Started container install-cnin Normal Pulling 23s kubelet Pulling image "jmgao1983/flannel"n Normal Pulled 2s kubelet Successfully pulled image "jmgao1983/flannel" in 20.788409144sn Normal Created 2s kubelet Created container kube-flanneln Normal Started 2s kubelet Started container kube-flannel

再次查看nodes状态

[root@master k8s]# kubectl get pod -n kube-flannelnNAME READY STATUS RESTARTS AGEnkube-flannel-ds-lg6th 1/1 Running 0 11mn[root@master k8s]# kubectl get nodesnNAME STATUS ROLES AGE VERSIONnmaster Ready control-plane,master 88m v1.23.9

精选推荐

  • 催化燃烧设备供应商
    催化燃烧设备供应商

    催化燃烧设备供应商,催化燃烧处理装置厂家,本装置是采用废气先进入喷淋塔过滤——干式过滤—-蜂窝活性碳吸附—脱附再生——催化燃

  • 该不该有模具供应商
    该不该有模具供应商

    今天红姐又来跟我探讨供应商的管理问题了。故事是这样的:供应商来料不良,原因是模具问题。而那个模具是我们找的一家模具供应商做的

  • 什么牌子高压锅好,高压锅哪个牌子好,高压锅什么牌子好,高压锅哪个品牌好
    什么牌子高压锅好,高压锅哪个牌子好,高

    1苏泊尔 双重安全阀门 高压锅双重安全阀,防烫把手,复合底。这款高压锅拥有双重安全阀门,更好的保证使用安全。搭载防烫伤把手,方便起

  • 高压锅啥牌子好,高压锅哪个牌子的好,什么高压锅牌子好,高压锅推荐选购指南
    高压锅啥牌子好,高压锅哪个牌子的好,什

    1、双喜阶梯型复底高压锅推荐理由:高压锅满足上蒸下煮,饭菜同时进行,方便快速,有效提升烹饪效率。多重安全防护,安全系数较高,家人使用

0