kubernetes-engine-samples
kubernetes-engine-samples copied to clipboard
WARNING: the gcp auth plugin is deprecated in v1.22+
Hello, is there any way to remove this warning from my GKE Autopilot cluster? If so how? Thank you!
W1014 10:44:08.794683 20354 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
Hello @jcquiles Can you share with us, where/when you see this error? Which sample were you trying out when you saw this warning!
@jcquiles do you remember which of the sample containers or tutorials you were following when you got that error?
Yes @Shabirmean @bourgeoisor it comes up when I start a GCP Autopilot cluster with kubectl commands. Its a warning about an update that has already passed, is there a way to get rid of it? This happens every time I use a kubectl command inside of the gcp autopilot cluster.
[gke_lido-360921_asia-northeast1_lido|default] ➜ dirk git:(main) ✗ k get nodes -o wide
W1026 10:34:32.931462 68029 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`
Do you get that error in Cloud Shell in the Google Cloud Console, or do you see it on your own machine / elsewhere?
Have you tried following the instructions here? https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
Yeah I did follow the instructions and even tried re-creating the cluster but am still have the same warning. I receive the error in my own machine, locally, have not tried cloud shell.
It's a client-sided error, unrelated to your GKE clusters, so you don't have to recreate it :)
What does gke-gcloud-auth-plugin --version
give you? What about echo $USE_GKE_GCLOUD_AUTH_PLUGIN
?
I actaully don't have gke-gcloud-auth-plugin
I believe I tried deleting it awhile ago. Should I have the environment variable configured?
[gke_lido-360921_asia-northeast1_lido|default] ➜ ~ gke-gcloud-auth-plugin --version
fish: Unknown command: gke-gcloud-auth-plugin
[gke_lido-360921_asia-northeast1_lido|default] ➜ ~ echo $USE_GKE_GCLOUD_AUTH_PLUGIN
[gke_lido-360921_asia-northeast1_lido|default] ➜
I'd take a look again at https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke but the idea is that starting in k8s 1.25+, you will need to have gke-gcloud-auth-plugin
installed (either through gcloud components
or through your package manager -- see instructions linked) and enabled to provide more security when accessing your GKE clusters.
The instructions may be slightly different depending on your platform / distribution, but I just did the following on a machine that was showing the warning:
-
Installed the auth plugin:
sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin
-
Added
export USE_GKE_GCLOUD_AUTH_PLUGIN=True
at the end of my ~/.bashrc -
Ran
source ~/.bashrc
to take that new env into effect immediately
And now I don't see the warning anymore when I run gcloud container clusters get-credentials
:)
Lemme know how it goes on your end.
Thank you for the guidance! Yes I no longer get the error = ) Executed the following steps.
- Im using
.zshrc
instead of.bashrc
- Installed
google-cloud-sdk-gke-gcloud-auth-plugin
-
export USE_GKE_GCLOUD_AUTH_PLUGIN=True
-
source ~/.zshhrc
-
gcloud components update
-
gcloud container clusters get-credentials CLUSTER_NAME
Great to hear :)