<p>After switching gcloud projects using ...</p>

<pre><code>gcloud init
</code></pre>

<p>... and then try to do some kubectl command, like this for instance:</p>

<pre><code>kubectl get rc
</code></pre>

<p>... I get this error:</p>

<pre><code>error: couldn't read version from server: Get
https://130.211.59.254/api: x509: certificate signed by unknown authority
</code></pre>

<p>Why is this and how can I solve it?</p>

<p>This is because the keys to your old cluster is cached. I'm not sure why they are not updated by the gcloud init command (that's what one would intuitively expect, or at least some kinder error message from kubectl)</p>

<p>You solve it by simply getting the credentials of the cluster in the new configuration:</p>

<pre><code>gcloud container clusters get-credentials YOURCLUSTERHERE --zone YOURCLUSTERZONEHERE
</code></pre>
