前往小程序,Get更优阅读体验!
立即前往
发布
社区首页 >专栏 >x509: certificate signed by unknown authority (possibly because of “crypto/rsa: verification error“

x509: certificate signed by unknown authority (possibly because of “crypto/rsa: verification error“

作者头像
johnhuster的分享
发布2022-03-28 20:47:55
发布2022-03-28 20:47:55
3.3K00
代码可运行
举报
文章被收录于专栏:johnhusterjohnhuster
运行总次数:0
代码可运行

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

代码语言:javascript
代码运行次数:0
复制
kubeadm init --pod-network-cidr 10.21.0.0/16 \
    --image-repository registry.cn-hangzhou.aliyuncs.com/google_containers

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

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

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

代码语言:javascript
代码运行次数:0
复制
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命令执行后的输出结果:

代码语言:javascript
代码运行次数:0
复制
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.

然后根据上面的提示把/etc/cni/net.d目录删掉,然后重新执行kubeadm init命令就可以了。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020/10/29 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档