<p>docker desktop on mac is getting error:</p>
<pre><code>Unable to connect to the server: x509: certificate signed by unknown authority
</code></pre>
<p>The <a href="https://stackoverflow.com/questions/46234295/kubectl-unable-to-connect-to-server-x509-certificate-signed-by-unknown-authori">following answers</a> didn't helped much:</p>
<p>My system details:</p>
<ul>
<li><p>Operating system: macOS Big Sur Version 11.6</p>
</li>
<li><p>Docker desktop version: v20.10.12</p>
</li>
<li><p>Kubernetes version: v1.22.5</p>
</li>
</ul>
<p>When I do:</p>
<pre><code>kubectl get pods
</code></pre>
<p>I get the below error:</p>
<pre><code>Unable to connect to the server: x509: certificate signed by unknown authority
</code></pre>

Amit Meena
<p>Posting the answer from comments</p>
<hr />
<p>As appeared after additional questions and answers, there was a previous installation of <code>rancher</code> cluster which left its traces: certificate and context in <code>~/.kube/config</code>.</p>
<p>The solution in this case for local development/testing is to delete entirely <code>~/.kube</code> folder with configs and init the cluster from the scratch.</p>
