<p>I created a GKE cluster and to connect to it with <code>kubectl</code> ran the command that appears when clicked on Connect button against my cluster.</p>

<pre class="lang-sh prettyprint-override"><code>gcloud container clusters get-credentials cluster-name --zone us-central1-a --project project-id
</code></pre>

<p>In <code>$HOME/.kube/config</code> I see entries as below:</p>

<pre><code>- name: cluster-name
  user:
    auth-provider:
      config:
        cmd-args: config config-helper --format=json
        cmd-path: /usr/lib64/google-cloud-sdk/bin/gcloud
        expiry-key: '{.credential.token_expiry}'
        token-key: '{.credential.access_token}'
      name: gcp
</code></pre>

<p>To add a new namespace, I did the following:</p>

<pre class="lang-sh prettyprint-override"><code>kubectl config use-context cluster-name
kubectl create namespace demo
</code></pre>

<p>This results in error:</p>

<pre class="lang-sh prettyprint-override"><code>error: No Auth Provider found for name "gcp"
</code></pre>

<p>I repeated the step of adding the credentials in the Google Cloud shell. There, I am able to create a new namespace successfully. I noticed that, the <code>access-token</code> and <code>expiry</code> fields are visible.</p>

<pre><code>auth-provider:
      config:
        access-token: omitted
        cmd-args: config config-helper --format=json
        cmd-path: /google/google-cloud-sdk/bin/gcloud
        expiry: "2019-12-10T03:39:53Z"
        expiry-key: '{.credential.token_expiry}'
        token-key: '{.credential.access_token}'
      name: gcp
</code></pre>

<p>Therefore, how do I get the <code>gcloud containers cluster get-credentials</code> command to update my <code>kubeconfig</code> correctly?</p>

<p>I ran into this exact problem, and it turned out my client was out of date.  Running v1.11 for the client and my cluster was 1.15+ gave me the <code>no auth provider</code> error.</p>
<p>Followed the instructions <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/" rel="nofollow noreferrer">here</a> to get up to client v1.18 and solved my issue.</p>
