: networkPlugin cni failed to teardown pod
Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "76701b91a8177ddcd370c4555343bfadc5baead790c140f9fecde3a629d7253e" network for pod "minio-b7b9cf94-v22qz": networkPlugin cni failed to set up pod "minio-b7b9cf94-v22qz_kubesphere-system" network: error getting ClusterInformation: connection is unauthorized: Unauthorized, failed to clean up sandbox container "76701b91a8177ddcd370c4555343bfadc5baead790c140f9fecde3a629d7253e" network for pod "minio-b7b9cf94-v22qz": networkPlugin cni failed to teardown pod "minio-b7b9cf94-v22qz_kubesphere-system" network: error getting ClusterInformation: connection is unauthorized: Unauthorized]
vmware正常运行的的k8s集群,在部署的时候突然无法发布,pod始终处于 creatingContainer的状态,使用kubectl describe命令查看后,报的问题
猜测原因是因为vmware的虚拟机挂起导致的,尝试重启每个节点的kubelet,并没有效果
解决方法:
,因为是测试环境,所以先用kubectl get pod -A 获取所有的pod
kubectl get pod -A
然后感觉哪个有问题就删哪个,先从kube-proxy开始删,再删 calico网络插件相关的,因为k8s有pod自动恢复机制,删除这些pod以后,会自动重建pod,要注意的是这些pod都在 kube-system的命名空间下,所以要注意删除的时候也要加 -n kube-system来指定命名空间,否则会报不存在的错误。
kubectl delete pod calico-kube-controllers-77959b97b9-rm8kv -n kube-system
kubectl delete pod calico-node-8kf68 -n kube-system
kubectl delete pod calico-node-cn9q4 -n kube-system
kubectl delete pod calico-node-hkfrw -n kube-system
kubectl delete pod kube-proxy-9cqct kube-proxy-qm4n5 kube-proxy-whkp6 -n kube-system
删了一遍就好用了
发现有一个一直 是 init 状态
查看是哪个节点的在运行:
watch -n3 'kubectl get po -A -owide | grep -v Running | grep -v Completed'
worker1 重启
然后恢复正常。 我的吗啊