1
0
Fork 0
mirror of https://github.com/imjasonh/gke-auth synced 2026-07-07 00:23:18 +00:00
No description
Find a file
2022-03-11 14:40:46 -05:00
.github/workflows use action from repo 2022-03-11 14:38:55 -05:00
.gitignore add goreleaser.yaml 2022-03-09 17:07:42 -05:00
.goreleaser.yaml add goreleaser.yaml 2022-03-09 17:07:42 -05:00
action.yaml allow unset vars 2022-03-11 14:40:46 -05:00
go.mod create kubeconfig dir if it doesn't exist 2022-03-11 14:27:08 -05:00
go.sum create kubeconfig dir if it doesn't exist 2022-03-11 14:27:08 -05:00
LICENSE initial commit 2022-03-09 16:16:14 -05:00
main.go create the file or whatever ugh 2022-03-11 14:32:35 -05:00
README.md document the action in README 2022-03-09 17:11:49 -05:00
setup.txt container.developer to see stuff in the cluster 2022-03-11 14:35:35 -05:00

Auth to GKE without gcloud

Installation

go install github.com/imjasonh/gke-auth@latest

Use

gke-auth --project=[MY_PROJECT] \
    --location=[REGION_OR_ZONE] \
    --cluster=[CLUSTER_NAME]

Now you have auth and kubeconfigs set up to use the cluster.

Or, using GitHub Actions:

- uses: imjasonh/gke-auth@v0.0.2
  with:
    project: [MY_PROJECT]
    location: [REGION_OR_ZONE]
    cluster: [CLUSTER_NAME]

You probably want to set up Workload Identity between your GitHub Actions workflow and your GCP project.

Test it with:

kubectl get pods

Why?

gcloud is great. It's like a Swiss army knife for the cloud, if a knife could do anything to a cloud.

It does so much. It does soooo much!

Too much.

This leads it to be really huge. Hundreds of megabytes of sweet delicious Python. Python that has to be interpreted before it can even start running anything.

If you're downloading and installing and running gcloud just to execute gcloud container clusters get-credentials -- especially in a CI environment -- you're wasting a lot of time.

Installing gcloud can take minutes, compared to just a few seconds with gke-auth, even if you have to build it from source.