尝试使用 minikube 运行 kubectl get pod 时无法读取客户端证书和客户端密钥

Abh*_*kar 5 ubuntu jenkins kubernetes minikube

我在 Ubuntu Linux VM 上并尝试在其上运行 minikube。

我通过 homebrew 安装了 kubectl,然后按照以下安装指南安装了 minikube:
kubectl:https: //kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-linux
minikube:https://kubernetes .io/docs/tasks/tools/install-minikube/

我启动了 minikube,sudo minikube start --driver=none它有以下输出:
在此输入图像描述

当我运行命令: 时kubectl get pods,出现错误:

Error in configuration:
* unable to read client-cert /home/jenkins/.minikube/profiles/minikube/client.crt for minikube due to open /home/jenkins/.minikube/profiles/minikube/client.crt: permission denied
* unable to read client-key /home/jenkins/.minikube/profiles/minikube/client.key for minikube due to open /home/jenkins/.minikube/profiles/minikube/client.key: permission denied
Run Code Online (Sandbox Code Playgroud)

我上面安装的用户是/home/jenkins. 我不确定出了什么问题。有人可以帮忙吗?

Vit*_*Vit 0

这种情况有两种典型情况:要么您的密钥在 minikube 安装期间未创建,要么您没有用户的适当权限。

For 1st case(not your) - you will clearly see in logs no such file or directory. To know more and how to resolve it - please refer to Unable to read client-cert/key Post Minikube Update

2nd is yours: client.crt: permission denied. Your current user doesnt have proper rights to read the file.

Resolution inside your screenshot. You should run below commands after cluster was created.

在此输入图像描述