我已经使用 calico 网络插件安装了 3 个节点的 Kubernetes 集群。
出于某种原因,我决定完全删除 kubernetes 并使用不同的网络插件重新安装它:Flannel。
一切看起来都很好,直到我尝试部署我的第一个容器。
kubectl describe pod/cassandra
返回以下错误:
Unknown desc = [failed to set up sandbox container "957f68c3cbe9b230b0e2bd6729a12c340f903de568622e28e335f7b48563a445" network for pod "cassandra-d7db46b86-dz7ck": networkPlugin cni failed to set up pod "cassandra-d7db46b86-dz7ck_default" network: error getting ClusterInformation: Get https://[10.96.0.1]:443/apis/crd.projectcalico.org/v1/clusterinformations/default: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes"), failed to clean up sandbox container "957f68c3cbe9b230b0e2bd6729a12c340f903de568622e28e335f7b48563a445" network for pod "cassandra-d7db46b86-dz7ck": networkPlugin cni failed to teardown pod "cassandra-d7db46b86-dz7ck_default" network: error getting ClusterInformation: Get https://[10.96.0.1]:443/apis/crd.projectcalico.org/v1/clusterinformations/default: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")]
Normal SandboxChanged 3s (x3 over 18s) kubelet, <node name> Pod sandbox changed, it will be killed and re-created.
通过阅读错误,似乎 Kubernetes 仍在使用 calico 插件,尽管我删除了它并安装了 Flannel 插件。
我怎样才能清理这个烂摊子?
- 清除ip路由:iprouteflushprotobird
- 删除所有节点中的所有 calico 链接
ip link list | grep cali | awk '{print $2}' | cut -c 1-15 | xargs -I {} ip link delete {}
- 删除 ipip 模块 modprobe -r ipip
- 删除 calico 配置
rm /etc/cni/net.d/10-calico.conflist && rm /etc/cni/net.d/calico-kubeconfig
- 重启 kubelet 服务
之后安装法兰绒。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)