simenandre / setup-gke-gcloud-auth-plugin

Installs a pre-requisite for "gcloud container clusters get-credentials" command with a modern k8s client.
Apache License 2.0
2 stars 3 forks source link

There is already a Google's action for this #7

Closed alexeyinkin closed 7 months ago

alexeyinkin commented 8 months ago

This action does the job for me: https://github.com/google-github-actions/get-gke-credentials

Can you mention it on README so people can find it easier?

simenandre commented 8 months ago

Hey! Yes, that is something we want!

I would love if you opened a PR on it. See #6 for more 🙌

ShaiShalevSQream commented 7 months ago

there is a problem with that plugin you mentioned for example, in case you want to use option "use_auth_provider", for cases you use a long term auth. and not you dont want to run the get credentials action again.

use_auth_provider - (Optional) If true, use the Google Cloud auth plugin in kubectl instead of a short-lived access token. The default value is false.

      - name: Set up Cloud SDK
        uses: google-github-actions/setup-gcloud@v2
        with:
          project_id: ${{ env.project }}
          install_components: 'gke-gcloud-auth-plugin'

      - name: get credentials for the kubectl
        uses: google-github-actions/get-gke-credentials@v2
        with:
          cluster_name: ${{ env.cluster_name }}
          location: ${{ env.region }}
          project_id: ${{ env.project }}
          use_auth_provider: true

will give you an error when trying to "kubectl get po"

Error: Kubernetes cluster unreachable: The gcp auth plugin has been removed.
Please use the "gke-gcloud-auth-plugin" kubectl/client-go credential plugin instead.