如何解决Docker Desktop Kubernetes的证书错误

rqdpfwrv  于 2023-05-28  发布在  Kubernetes
关注(0)|答案(1)|浏览(318)

我已经按照https://docs.docker.com/get-started/kube-deploy/的步骤在Docker Desktop for Mac中启用了Kubernetes。我可以运行一些命令,如kubectl applykubectl get,但其他命令,如kubectl execkubectl logs失败如下:

$ kubectl.docker logs -n kube-system kube-apiserver-docker-desktop
Error from server: Get "https://192.168.65.4:10250/containerLogs/kube-system/kube-apiserver-docker-desktop/kube-apiserver": open /run/config/pki/apiserver-kubelet-client.crt: no such file or directory

我该如何解决这个问题?

$ kubectl.docker version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.24.0
Kustomize Version: v4.5.4
Server Version: v1.24.0
$ docker version
Client:
 Cloud integration: v1.0.24
 Version:           20.10.14
 API version:       1.41
 Go version:        go1.16.15
 Git commit:        a224086
 Built:             Thu Mar 24 01:49:20 2022
 OS/Arch:           darwin/arm64
 Context:           default
 Experimental:      true

Server: Docker Desktop 4.8.2 (79419)
 Engine:
  Version:          20.10.14
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.15
  Git commit:       87a90dc
  Built:            Thu Mar 24 01:45:44 2022
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.5.11
  GitCommit:        3df54a852345ae127d1fa3092b95168e4a88e2f8
 runc:
  Version:          1.0.3
  GitCommit:        v1.0.3-0-gf46b6ba
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
wmomyfyw

wmomyfyw1#

您可以检查此引用forum,并根据rimelek,
他们建议运行命令
chmod +xr /usr/local/bin
重新启动Docker后,可以访问Kubernetes命令,甚至Kubernetes上下文菜单

相关问题