首页 新闻 搜索 专区 学院

k8s集群coredns启动异常

0
悬赏园豆:15 [已解决问题] 解决于 2021-10-25 16:16
  • 环境
ubuntu 20.4.3
  • 报错内容
Events:
  Type     Reason                  Age   From               Message
  ----     ------                  ----  ----               -------
  Normal   Scheduled               15s   default-scheduler  Successfully assigned kube-system/coredns-58c86fb885-2l6vh to db-storagea
  Warning  FailedCreatePodSandBox  14s   kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "1bcad3baf705a2989a902e9d36536e161b4acacd4225ca3bcb52700e363869ea" network for pod "coredns-58c86fb885-2l6vh": networkPlugin cni failed to set up pod "coredns-58c86fb885-2l6vh_kube-system" network: error getting ClusterInformation: connection is unauthorized: Unauthorized, failed to clean up sandbox container "1bcad3baf705a2989a902e9d36536e161b4acacd4225ca3bcb52700e363869ea" network for pod "coredns-58c86fb885-2l6vh": networkPlugin cni failed to teardown pod "coredns-58c86fb885-2l6vh_kube-system" network: error getting ClusterInformation: connection is unauthorized: Unauthorized]
  Normal   SandboxChanged          13s   kubelet            Pod sandbox changed, it will be killed and re-created.

重启还是这样,找不到头绪,在此求助,希望有人知道咋回事。

小黑狗cathy的主页 小黑狗cathy | 初学一级 | 园豆:76
提问于:2021-10-19 20:51
< >
分享
最佳答案
0

看下 vim /etc/resolv.conf里dns指向不要写自己的地址。改成114.114.114.114

收获园豆:15
Ealien | 菜鸟二级 |园豆:217 | 2021-10-21 18:00

原因是/etc/cni/net.d/目录下的配置文件未正常识别。因为我先使用calico,然后切换到flannel。flannel启动后读取的配置文件依然是calico的。导致coredns异常。清除/etc/cni/net.d/下的calico配置,重启flannel就好了。

  • 参考文章
https://blog.csdn.net/mayifan0/article/details/119674569
小黑狗cathy | 园豆:76 (初学一级) | 2021-10-25 16:15
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册