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.
重启还是这样,找不到头绪,在此求助,希望有人知道咋回事。
看下 vim /etc/resolv.conf里dns指向不要写自己的地址。改成114.114.114.114
原因是/etc/cni/net.d/目录下的配置文件未正常识别。因为我先使用calico,然后切换到flannel。flannel启动后读取的配置文件依然是calico的。导致coredns异常。清除/etc/cni/net.d/下的calico配置,重启flannel就好了。
https://blog.csdn.net/mayifan0/article/details/119674569