<p>I have two kubernetes clusters on google container engine but on seperate google accounts (one using my company's email and another using my personal email). I attempted to switch from one cluster to another. I did this by:</p>

<ol>
<li><p>Logging in with my other email address</p>

<p><code>$ gcloud init</code></p></li>
<li><p>Getting new kubectl credentials</p>

<p><code>gcloud container cluster get-credentials</code></p></li>
<li><p>Test to see if connected to new cluster</p>

<p><code>$ kubectl get po</code></p></li>
</ol>

<p>However, I was still not able to get the kubernetes resources in the cluster. The error I received was:</p>

<p><code>the server doesn't have a resource type "pods"</code></p>

<p>This occurs because although I logged in with the new credentials... kubectl isn't using the new credentials. In order to change the login/access credentials that kubectl will use to access your cluster you need to run the following command:</p>

<pre><code>gcloud auth application-default login
</code></pre>

<p>You will then get the following response:</p>

<pre><code>Your browser has been opened to visit:

https://accounts.google.com/o/oauth2/auth
redirect_uri=http%3A%2F%2Flocalhost%3A8085%2F&amp;prompt=select_account&amp;respons
e_type=code&amp;client_id=...&amp;
scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email
+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&amp;access_type=offline

Credentials saved to file: [/Users/.../.config/gcloud/application_default_credentials.json]

These credentials will be used by any library that requests
Application Default Credentials.
</code></pre>

<p>Then get cluster credentials</p>

<p><code>gcloud container clusters get-credentials [cluster name/id]</code></p>

<p>You should now be able to access the cluster using kubectl.</p>
