Get https://[10.96.0.1]:443/apis/crd.projectcalico.org/v1/clusterinformations/default: x509: certif

现象:

执行下面命令初始化k8s集群时

kubeadm init --config init-defaults

通过 kubectl get pods -n kube-system 查看pods状态

发现coredns对应的pod状态为ContainerCreating,

通过kubectl describe pods -n kube-system coredns-6c76c8bb89-9br5d 查看对应pod状态有下面错误信息:

reate pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "5ac64afb8a4f7c98aeeb5f459a80410cb9b180ad92322adc0bfe0b9ce1c81107" network for pod "coredns-6c76c8bb89-jlzgn": networkPlugin cni failed to set up pod "coredns-6c76c8bb89-jlzgn_kube-system" 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 "5ac64afb8a4f7c98aeeb5f459a80410cb9b180ad92322adc0bfe0b9ce1c81107" network for pod "coredns-6c76c8bb89-jlzgn": networkPlugin cni failed to teardown pod "coredns-6c76c8bb89-jlzgn_kube-system" 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")]
 

原因:

原有环境未清理干净

解决办法:

kubeadm reset命令执行后的输出结果:

The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d

The reset process does not reset or clean up iptables rules or IPVS tables.
If you wish to reset iptables, you must do so manually by using the "iptables" command.

If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
to reset your system's IPVS tables.

The reset process does not clean your kubeconfig files and you must remove them manually.
Please, check the contents of the $HOME/.kube/config file.

根据上面提示:
执行

#rm -rf   /etc/cni/net.d
#ipvsadm --clear
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值