client-go
client-go copied to clipboard
"WARNING: the gcp auth plugin is deprecated" come up even if followed all the instructions
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.
This happened to me as well when upgrading kubectl to v1.24. I ended up downgrading back to v1.22
Can we have a way to disable this warning? It seems counter-productive. Thank you!
@adam-epam As far as I've seen on the internet there is no way to suppress the warning in kubectl ;/
- might be wrong
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
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?
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 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
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/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas 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
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/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas 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
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.
@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
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/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas 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: 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/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closedYou 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.
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:
-
If you already have
google-cloud-cliinstalled, you MUST remove that first before continuing:sudo apt-get remove google-cloud-cli -
Follow the instructions here, however, use
google-cloud-sdkinstead (-sdknot-cli)!sudo apt-get update && sudo apt-get install google-cloud-sdk -
If the Docker Desktop managed version of
kubectlis earlier thanv1.26, follow instructions under "WARNING: the gcp auth plugin is deprecated, use gcloud instead" (e.g. set theUSE_GKE_GCLOUD_AUTH_PLUGINenvironment variable). However, it may fail slightly atgcloud components update, so... -
Just manually run the command
gcloud components updatetells 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-oidcNote: This is
--only-upgradeso don't worry aboutkubectlbeing present if you are letting Docker manage it for you. -
Finally, ensure you still update cluster credentials per the fix in that documentation, e.g.
gcloud container clusters get-credentials CLUSTER_NAME