Skip to content

simenandre/setup-gke-gcloud-auth-plugin

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simenandre/setup-gke-gcloud-auth-plugin

⚠️ This plugin is deprecated. See the migration guide for how to achieve the same using Google's own github action

This GitHub Actions installs a pre-requisite for "gcloud container clusters get-credentials" command with a modern k8s client.

Quickstart

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

Example

name: On Push

permissions:
  id-token: write
  contents: read

on:
  push:
    branches:
      - main

jobs:
  apply-changes:
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Authenticate to GCP
        uses: google-github-actions/auth@v1
        with:
          credentials_json: ${{ secrets.GOOGLE_PROJECT_SA_KEY }}
          project_id: ${{ secrets.GOOGLE_PROJECT_ID }}

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

      - uses: google-github-actions/get-gke-credentials@v1
        with:
          cluster_name: my-cluster
          location: us-central1-a

      # At this point you should be able to communicate with your cluster
      - run: kubectl get pods

Assuming this is your current setup using this plugin:

- name: Authenticate to Google
  uses: "google-github-actions/auth@v1"
  with:
    credentials_json: "${{ secrets.GCP_SERVICEACCOUNT_KEY }}"

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

- name: Authenticate to GKE cluster
  uses: google-github-actions/get-gke-credentials@v1
  with:
    cluster_name: my_cluster
    location: europe-west1-b

Migrating to get-gke-credentials can be done like so:

- name: Authenticate to Google
  uses: "google-github-actions/auth@v2"
  with:
    credentials_json: "${{ secrets.GCP_SERVICEACCOUNT_KEY }}"

- uses: "google-github-actions/setup-gcloud@v2"
  with:
    install_components: "gke-gcloud-auth-plugin"

- name: Authenticate to GKE cluster
  uses: google-github-actions/get-gke-credentials@v2
  with:
    cluster_name: my_cluster
    location: europe-west1-b

About

Installs a pre-requisite for "gcloud container clusters get-credentials" command with a modern k8s client.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published