coredns 一直处于 Pending 或者 ContainerCreating 状态

coredns 一直处于 Pending 或者 ContainerCreating 状态

1. 问题描述

coresdns 状态一直处于 Pending 或者 ContainerCreating 状态

Events:
  Type     Reason                  Age                  From                              Message
  ----     ------                  ----                 ----                              -------
  Warning  FailedScheduling        11m (x6 over 16m)    default-scheduler                 0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate.
  Normal   Scheduled               11m                  default-scheduler                 Successfully assigned kube-system/coredns-5c98db65d4-hb7hd to izm5e3cntl0pztm4dj3phrz
  Warning  FailedCreatePodSandBox  11m                  kubelet, izm5e3cntl0pztm4dj3phrz  Failed create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "fc6ab00e36704719d84c6d8e7cb9135d10b5d255f290b379678a3df1b312c246" network for pod "coredns-5c98db65d4-hb7hd": NetworkPlugin cni failed to set up pod "coredns-5c98db65d4-hb7hd_kube-system" network: failed to find plugin "loopback" in path [/opt/cni/bin], failed to clean up sandbox container "fc6ab00e36704719d84c6d8e7cb9135d10b5d255f290b379678a3df1b312c246" network for pod "coredns-5c98db65d4-hb7hd": NetworkPlugin cni failed to teardown pod "coredns-5c98db65d4-hb7hd_kube-system" network: failed to find plugin "portmap" in path [/opt/cni/bin]]
  Normal   SandboxChanged          102s (x48 over 11m)  kubelet, izm5e3cntl0pztm4dj3phrz  Pod sandbox changed, it will be killed and re-created.

coredns会一直处于ContainerCreating状态,从事件中可以看出,是因为bin文件还没有。

 network: failed to find plugin "loopback" in path [/opt/cni/bin]
2. 解决方法

安装cni,此处以flannel 为例

1. mkdir -p $GOPATH/src/github.com/containernetworking/plugins

2. git clone https://github.com/containernetworking/plugins.git

3. ./build_linux.sh

4. 如果 /opt/cni/bin 不存在
   mkdir -p /opt/cni/bin
   cp bin/* /opt/cni/bin

5. ls bin/
   bandwidth  dhcp      flannel      host-local  loopback  portmap  sbr     tuning
   bridge     firewall  host-device  ipvlan      macvlan   ptp      static  vlan
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值