<p>In Google Cloud Platform I have a Container-Cluster with three running instances. I now want to connect from my terminal to be able to run <code>kubectl</code> commands. For this I ran the command </p>

<pre><code>gcloud container clusters get-credentials cluster-1 --zone europe-west1-b --project project-id
</code></pre>

<p>I am using the real project name of course. This is the command shown by the dashboard when clicking on 'connect with the cluster'. The output of this command is:</p>

<pre><code>Fetching cluster endpoint and auth data.
kubeconfig entry generated for cluster-1.
</code></pre>

<p>But when I run <code>kubectl</code>commands afterwards like <code>kubectl cluster-info</code> I always get:</p>

<pre><code>Unable to connect to the server: oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error" : "invalid_grant",
  "error_description" : "Token has been revoked."
}
</code></pre>

<p>What am I missing here? <code>gcloud</code> commands like <code>gcloud container clusters list</code> work</p>

<p>I tried from a different machine at home, and there it was working after installing and setting up gcloud. I think that on my work machine there is still an oauth token stored with which I authenticated to a different google account I used for a test.</p>

<p><strong>Edit:</strong> I got it running now. the problem was that I missed the second of the necessary calls:</p>

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