kubectl giving error: Unable to connect to the server: x509: certificate signed by unknown authority

kubectl giving error: Unable to connect to the server: x509: certificate signed by unknown authority

docker mac 上的桌面出现错误:

Unable to connect to the server: x509: certificate signed by unknown authority

没有多大帮助:

我的系统详细信息:

当我这样做时:

kubectl get pods

我收到以下错误:

Unable to connect to the server: x509: certificate signed by unknown authority

发布评论中的答案


如在其他问题和答案后出现的那样,之前安装的 rancher 集群留下了痕迹:~/.kube/config 中的证书和上下文。

在这种情况下,本地 development/testing 的解决方案是完全删除包含配置的 ~/.kube 文件夹并从头开始初始化集群。