<p>I've follwed the steps at <a href="https://docs.docker.com/get-started/kube-deploy/" rel="nofollow noreferrer">https://docs.docker.com/get-started/kube-deploy/</a> to enable Kubernetes in Docker Desktop for Mac. I can run some commands like <code>kubectl apply</code> and <code>kubectl get</code>, but other commands like <code>kubectl exec</code> and <code>kubectl logs</code> fail like so:</p>
<pre><code>$ kubectl.docker logs -n kube-system kube-apiserver-docker-desktop
Error from server: Get &quot;https://192.168.65.4:10250/containerLogs/kube-system/kube-apiserver-docker-desktop/kube-apiserver&quot;: open /run/config/pki/apiserver-kubelet-client.crt: no such file or directory
</code></pre>
<p>How can I work around this?</p>
<pre><code>$ 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
</code></pre>
<pre><code>$ 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
</code></pre>

rcorre
<p>You may check this reference <a href="https://forums.docker.com/t/enable-docker-commands-run-without-sudo/135671/14" rel="nofollow noreferrer">forum</a> and as per rimelek,</p>
<p>They recommended running the command</p>
<blockquote>
<p>chmod +xr /usr/local/bin</p>
</blockquote>
<p>After rebooting Docker, Kubernetes commands are accessible and even Kubernetes context menu</p>
