kubeadm部署k8s,coredns一直处于containercreating状态failed to find plugin “flannel“ in path [/opt/cni/bin]]
coredns始终处于containercreating状态coredns镜像拉取不下来,只能手动拉去之后修改tag进行解决这个问题
·
问题:
coredns始终处于containercreating状态
coredns镜像拉取不下来,只能手动拉去之后修改tag进行解决这个问题,具体步骤如下:
[root@master ~]# kubectl get pod -A
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-bccdc95cf-86nc6 0/1 ContainerCreating 0 99s
kube-system coredns-bccdc95cf-wsm6r 0/1 ContainerCreating 0 93s
kube-system etcd-master 1/1 Running 0 13h
kube-system kube-apiserver-master 1/1 Running 0 13h
kube-system kube-controller-manager-master 1/1 Running 1 13h
kube-system kube-flannel-ds-amd64-dwc7j 1/1 Running 0 29m
kube-system kube-flannel-ds-amd64-gxvpp 1/1 Running 0 29m
kube-system kube-flannel-ds-amd64-mszpw 1/1 Running 0 29m
kube-system kube-proxy-4twck 1/1 Running 0 13h
kube-system kube-proxy-stzxb 1/1 Running 0 13h
kube-system kube-proxy-w7v2b 1/1 Running 0 13h
kube-system kube-scheduler-master 1/1 Running 1 13h
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 46s default-scheduler Successfully assigned kube-system/coredns-bccdc95cf-86nc6 to node1
Warning FailedCreatePodSandBox 45s kubelet, node1 Failed create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "bfadab3147650499aee00f528807c811bc9c072acc3630fd0ce47e3dc1687de6" network for pod "coredns-bccdc95cf-86nc6": NetworkPlugin cni failed to set up pod "coredns-bccdc95cf-86nc6_kube-system" network: failed to find plugin "flannel" in path [/opt/cni/bin], failed to clean up sandbox container "bfadab3147650499aee00f528807c811bc9c072acc3630fd0ce47e3dc1687de6" network for pod "coredns-bccdc95cf-86nc6": NetworkPlugin cni failed to teardown pod "coredns-bccdc95cf-86nc6_kube-system" network: failed to find plugin "flannel" in path [/opt/cni/bin]]
Normal SandboxChanged 8s (x4 over 45s) kubelet, node1 Pod sandbox changed, it will be killed and re-created.
解决:
首先,确定coredns这两个pod处于哪个node上
kubectl get pods coredns-59d64cd4d4-cvgv5 -n kube-system -o wide
之后查看coredns所需镜像
[root@master ~]# kubectl get pods coredns-545d6fc579-nhqvj -n kube-system -o yaml | grep image:
image: registry.aliyuncs.com/google_containers/coredns/coredns:v1.8.0
登录coredns所在的node机器,进行手动拉去镜像
docker pull coredns/coredns:1.8.0
拉取成功后,进行修改tag,修改为与所需要的一致即可
docker tag coredns/coredns registry.aliyuncs.com/google_containers/coredns:v1.8.0
修改完成之后,回到master查看,可以发现现在coredns就已经处于running状态了
更多推荐
已为社区贡献1条内容
所有评论(0)