google-github-actions / get-gke-credentials

A GitHub Action that configure authentication to a GKE cluster.
https://cloud.google.com/gke
Apache License 2.0
100 stars 41 forks source link

Support gke-gcloud-auth-plugin #264

Open Markieta opened 1 year ago

Markieta commented 1 year ago

TL;DR

Need an option for using gke-gcloud-auth-plugin instead of gcp auth plugin or short-lived access tokens.

use_auth_provider fails on modern versions of GKE:

error: The gcp auth plugin has been removed.
Please use the "gke-gcloud-auth-plugin" kubectl/client-go credential plugin instead.
See https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke for further details
Error: Process completed with exit code 1.

Detailed design

No response

Additional information

No response

michaeldelago commented 1 year ago

I'd consider this a bug, rather than an enhancement. If the auth plugin doesn't get added, kubectl will break.

simenandre commented 1 year ago

Hello 👋

I've created a simple GitHub Action for this, feel free to use this until someone integrates setup-gke-gcloud-auth-plugin into get-gke-credentials. I'll try to keep users of simenandre/setup-gke-gcloud-auth-plugin updated on using gke-gcloud-auth-plugin with GitHub Actions as we go.

To get started, drop this in your workflow:

- uses: simenandre/setup-gke-gcloud-auth-plugin@v1

Feel free to open issues and PRs here: https://github.com/simenandre/setup-gke-gcloud-auth-plugin

chamini2 commented 6 months ago

Moving to google-github-actions v2 for all actions I need seem to work now for my use case.