<p>I configured my config file and when I run :</p>
<pre><code>kubectl get nodes
</code></pre>
<p>I have this error :</p>
<pre><code>Unable to connect to the server: x509: certificate signed by unknown authority
</code></pre>
<p>I tried all this command but it still change nothing :</p>
<pre><code>kubectl config set-cluster ${KUBE_CONTEXT} --insecure-skip-tls-verify=true \
--server=${KUBE_CONTEXT} 
--insecure-skip-tls-verify=true 

kubectl proxy --address 0.0.0.0 --accept-hosts '.*'
</code></pre>

<p><strong>The error indicates a possible certificate mismatch</strong>.</p>
<p>Verify that the <code>$HOME/.kube/config</code> file contains a valid certificate, and regenerate a certificate if necessary.</p>
<p>Unset the KUBECONFIG environment variable using:</p>
<pre><code>unset KUBECONFIG
</code></pre>
<p>Or set it to the default KUBECONFIG location:</p>
<pre><code>export KUBECONFIG=/etc/kubernetes/admin.conf
</code></pre>
<p><strong>Another workaround is to overwrite the existing kubeconfig for the &quot;admin&quot; user</strong></p>
<pre><code>mv  $HOME/.kube $HOME/.kube.bak
mkdir $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
</code></pre>
<p>Refer <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/#tls-certificate-errors" rel="noreferrer">Link</a></p>
