client-go icon indicating copy to clipboard operation
client-go copied to clipboard

"WARNING: the gcp auth plugin is deprecated" come up even if followed all the instructions

Open artemdumanov opened this issue 3 years ago • 11 comments
trafficstars

I'm working with the gke cluster and have got a warning for any kubectl command.

W0509 17:55:55.415853  113282 gcp.go:120] WARNING: the gcp auth plugin is deprecated in v1.22+, unavailable in v1.25+; use gcloud instead.
To learn more, consult https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke

Versions.

$ k version
W0509 18:01:34.450905  114335 gcp.go:120] WARNING: the gcp auth plugin is deprecated in v1.22+, unavailable in v1.25+; use gcloud instead.
To learn more, consult https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.0", GitCommit:"4ce5a8954017644c5420bae81d72b09b735c21f0", GitTreeState:"clean", BuildDate:"2022-05-03T13:46:05Z", GoVersion:"go1.18.1", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"20+", GitVersion:"v1.20.15-gke.3400", GitCommit:"750002971a60d8a06e0a403c52724257f0f68481", GitTreeState:"clean", BuildDate:"2022-03-08T09:33:43Z", GoVersion:"go1.15.15b5", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.24) and server (1.20) exceeds the supported minor version skew of +/-1

I went to the page with instructions and installed a component with the apt-get command, updated bash, reconnect to the cluster and etc. But I still had been seeing the warning.

I said ok, my bad. Lets do it right way and install the component with gcloud components install gke-gcloud-auth-plugin command. But I was not able becuase I had installed google cli with the apt, so I reinstalled the gcloud cli, and did all the required operations described in the instruction. The result is the same and lame warning that pretty annoyes me.

The bottom line is that I did follow every instruction described in the doc and 2 ways but still see the warning. There are 2 ways. Or I do something wrong or I take the audacity to say we got a bug here.

artemdumanov avatar May 09 '22 15:05 artemdumanov

This happened to me as well when upgrading kubectl to v1.24. I ended up downgrading back to v1.22

ronisec avatar May 10 '22 10:05 ronisec

Can we have a way to disable this warning? It seems counter-productive. Thank you!

adambenhassen avatar May 11 '22 14:05 adambenhassen

@adam-epam As far as I've seen on the internet there is no way to suppress the warning in kubectl ;/

  • might be wrong

artemdumanov avatar May 11 '22 16:05 artemdumanov

Hello,

On my side I'm using a KUBECONFIG file, in which the auth-provider name is set to gcp

And I have this deprecated message too.

I don't know on which auth-provider name I should switch to be able to use the recommended gke-gcloud-auth-plugin.

any ideas ?

Thank you very much

lasdou avatar May 12 '22 09:05 lasdou

Warning started appearing today, followed the instructions and still have the warning. Also in the KUBECONFIG file still have the auth provider set as gcp as @lasdou is mentioning below.

Any ideas?

lbanchero avatar May 12 '22 17:05 lbanchero

I identified the problem, at least for my case... I had a wrong kubectl binary on my machine.

Seems that kubectl command I was using was from docker... I assume minikube.

I had to install kubectl from this guide and at the end had this warning:

WARNING: There are other instances of Google Cloud tools on your system PATH. Please remove the following to avoid confusion or accidental invocation: /Applications/Docker.app/Contents/Resources/bin/kubectl

Just deleted that binary and problem solved.

lbanchero avatar May 13 '22 11:05 lbanchero

@lbanchero your suggestion worked for me. I had installed minikube with brew and the version of kubectl that came with it was being used by my shell. Here is what I did:

$ brew uninstall kubectl --ignore-dependencies
$ gcloud components install kubectl
$ mv /Applications/Docker.app/Contents/Resources/bin/kubectl /Applications/Docker.app/Contents/Resources/bin/kubectl.bak

I note that the version installed by gcloud was v1.23.3 but the version I had previous from minikube was 1.24.0

groksrc avatar May 27 '22 21:05 groksrc

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Aug 25 '22 22:08 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Sep 24 '22 22:09 k8s-triage-robot

I think the gcloud documentation has the flag set backwards.

I changed USE_GKE_GCLOUD_AUTH_PLUGIN=False to USE_GKE_GCLOUD_AUTH_PLUGIN=true

~/.kube/config looks correct and I don't get the warning.

mikedd avatar Sep 30 '22 13:09 mikedd

@lbanchero thanks a lot, your comments help me to figure it out.

After install kubectl from your guide, I had to delete another instance that i had in Docker: "C:\Program Files\Docker\Docker\resources\bin" and the warning is gone

echaviano avatar Oct 20 '22 15:10 echaviano

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Nov 19 '22 15:11 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Nov 19 '22 15:11 k8s-ci-robot

Getting this problem on WSL2 as well (Debian 11), even after following all the provided instructions. Granted, I am using Docker Desktop for Windows which manages kubectl for me, it was ultimately fine, it was a new enough version (v1.25.2 as of writing this). The official instructions both for installing the SDK on Debian as well as for installing kubectl on Debian don't quite work for this distro for some reason.

It turns out, after much hair pulling and frustration, the instructions on the SDK quickstart tell you to install google-cloud-cli when I think you really should instead be installing the google-cloud-sdk package. For me it seems only one or the other can be installed (at least in my case, trying to install both resulted in a conflict on a shared file, /usr/share/google-cloud-sdk/completion.zsh.inc).

Anyway, after ensuring you use google-cloud-sdk instead (i.e. ensure you remove google-cloud-cli first) and then going through the steps to force it to use the gke-gcloud-auth-plugin (that was already installed) by following the "WARNING: the gcp auth plugin is deprecated, use gcloud instead" section help section, which also inevitably fails at the gcloud components update step but works if you manually run the provided sudo apt-get ... install commands.


So... TL;DR: If you have Docker Desktop for Windows and are using the Debian distro for WSL2 and still get that pesky warning, even after following the official Debian instructions, use this fix:

  1. If you already have google-cloud-cli installed, you MUST remove that first before continuing:

    sudo apt-get remove google-cloud-cli
    
  2. Follow the instructions here, however, use google-cloud-sdk instead (-sdk not -cli)!

    sudo apt-get update && sudo apt-get install google-cloud-sdk
    
  3. If the Docker Desktop managed version of kubectl is earlier than v1.26, follow instructions under "WARNING: the gcp auth plugin is deprecated, use gcloud instead" (e.g. set the USE_GKE_GCLOUD_AUTH_PLUGIN environment variable). However, it may fail slightly at gcloud components update, so...

  4. Just manually run the command gcloud components update tells you to run, i.e. right now for me that was:

    sudo apt-get update && sudo apt-get --only-upgrade install \
        google-cloud-sdk-skaffold \
        google-cloud-sdk-spanner-emulator \
        google-cloud-sdk-bigtable-emulator \
        google-cloud-sdk-kpt \
        google-cloud-sdk-gke-gcloud-auth-plugin \
        google-cloud-sdk-app-engine-go \
        google-cloud-sdk-config-connector \
        google-cloud-sdk-harbourbridge \
        google-cloud-sdk-firestore-emulator \
        google-cloud-sdk-datalab \
        google-cloud-sdk-app-engine-python-extras \
        google-cloud-sdk-minikube \
        google-cloud-sdk-local-extract \
        google-cloud-sdk-pubsub-emulator \
        google-cloud-sdk-app-engine-java \
        google-cloud-sdk-app-engine-grpc \
        kubectl \
        google-cloud-sdk-anthos-auth \
        google-cloud-sdk-nomos \
        google-cloud-sdk-terraform-tools \
        google-cloud-sdk-datastore-emulator \
        google-cloud-sdk-package-go-module \
        google-cloud-sdk \
        google-cloud-sdk-app-engine-python \
        google-cloud-sdk-cloud-run-proxy \
        google-cloud-sdk-log-streaming \
        google-cloud-sdk-cloud-build-local \
        google-cloud-sdk-cbt \
        google-cloud-sdk-kubectl-oidc
    

    Note: This is --only-upgrade so don't worry about kubectl being present if you are letting Docker manage it for you.

  5. Finally, ensure you still update cluster credentials per the fix in that documentation, e.g.

    gcloud container clusters get-credentials CLUSTER_NAME
    

patricknelson avatar Dec 06 '22 02:12 patricknelson