kubernetes-engine-samples icon indicating copy to clipboard operation
kubernetes-engine-samples copied to clipboard

WARNING: the gcp auth plugin is deprecated in v1.22+

Open jcquiles opened this issue 2 years ago • 1 comments

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

jcquiles avatar Oct 14 '22 17:10 jcquiles

Hello @jcquiles Can you share with us, where/when you see this error? Which sample were you trying out when you saw this warning!

Shabirmean avatar Oct 17 '22 16:10 Shabirmean

@jcquiles do you remember which of the sample containers or tutorials you were following when you got that error?

bourgeoisor avatar Nov 03 '22 14:11 bourgeoisor

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`

jcquiles avatar Nov 03 '22 15:11 jcquiles

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

bourgeoisor avatar Nov 03 '22 18:11 bourgeoisor

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.

jcquiles avatar Nov 03 '22 18:11 jcquiles

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?

bourgeoisor avatar Nov 03 '22 19:11 bourgeoisor

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] ➜

jcquiles avatar Nov 03 '22 20:11 jcquiles

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.

bourgeoisor avatar Nov 03 '22 21:11 bourgeoisor

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

jcquiles avatar Nov 03 '22 22:11 jcquiles

Great to hear :)

bourgeoisor avatar Nov 03 '22 23:11 bourgeoisor