<p>In my /root/.kube/config I have a server: value of &quot;https://my.reverse.proxy:6443&quot;.</p>
<p>If I don't set any certificates on the reverse proxy (traffic goes directly to backend and backend certificate is presented, SSL passthrough), I can run a kubectl command successfully (i.e sudo kubectl get pods -o wide -A). But if I set a certificate on the reverse proxy, my kubectl command returns:</p>
<pre><code>$ sudo kubectl --insecure-skip-tls-verify get pods -o wide -A
error: You must be logged in to the server (Unauthorized)
</code></pre>
<p>I am not sure why this is happening. Is it because the kubectl is trying to &quot;authenticate&quot; with the reverse proxy certificate, and is only allowed to do so with the back-end certificate?</p>
<p>How would I get rid of that error if I want to use a different certificate on the reverse proxy (no SSL passthrough)? What should I do on the client side?</p>

Joey Cote
<p>If the issue started after renewing kubernetes certificates, this caused the existing <strong>~/.kube/config</strong> to have outdated keys and certificate values in it.</p>
<p>The solution is to replace the values <strong>client-certificate-data</strong> and <strong>client-key-data</strong> in file <strong>~/.kube/config</strong> with the values from the updated file in <strong>/etc/kubernetes/kubelet.conf</strong> of the same name</p>
