<p>In CI, with gcp auth plugin I was using gcloud auth activate-service-account ***@developer.gserviceaccount.com --key-file ***.json prior to execute kubectl commands.
Now with gke-gcloud-auth-plugin I can’t find any equivalent to use a gcp service account key file.
I've installed <code>gke-gcloud-auth-plugin</code> and <code>gke-gcloud-auth-plugin --version</code> is giving me <code>Kubernetes v1.25.2-alpha+ae91c1fc0c443c464a4c878ffa2a4544483c6d1f</code>
Would you know if there’s a way?</p>
<p>I tried to add this command:
<code>kubectl config set-credentials my-user --auth-provider=gcp</code>
But I still get:</p>
<pre><code>error: The gcp auth plugin has been removed. Please use the &quot;gke-gcloud-auth-plugin&quot; kubectl/client-go credential plugin instead.
</code></pre>

bonomo
<p>You will need to set the env variable to use the new plugin before doing the <code>get-credentials</code>:</p>
<pre class="lang-bash prettyprint-override"><code>export USE_GKE_GCLOUD_AUTH_PLUGIN=True
gcloud container clusters get-credentials $CLUSTER \
  --region $REGION \
  --project $PROJECT \
  --internal-ip
</code></pre>
<p>I would not have expected the env variable to still be required (now that the gcp auth plugin is completely deprecated) - but it seems it still is.</p>
<p>Your kubeconfig will end up looking like this if the new auth provider is in use.</p>
<pre class="lang-yaml prettyprint-override"><code>...
- name: $NAME
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      command: gke-gcloud-auth-plugin
      installHint: Install gke-gcloud-auth-plugin for use with kubectl by following
        https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
      provideClusterInfo: true
</code></pre>
