TIL Recover GKE kubeconfig
I found myself needing to teach kubectl
how to connect to a particular GKE cluster -- fast. âĄī¸
Here's the recipe, which assumes gcloud
is set up properly for the correct Google Cloud account.
đ Let's go!
What was the cluster name again?
gcloud container clusters list
Copy the correct cluster name. Let's use catsonk8s
for our example. The magic is all in the next command:
gcloud container clusters get-credentials catsonk8s --zone us-east1-c
Fetching cluster endpoint and auth data.
kubeconfig entry generated for catsonk8s.
You'll need to adjust the --zone
value to suit or use --region
.
đ All done! Commands like kubectl get pods
are all set up to talk to the cluster.
đ Good luck with whatever Kubernetes problem you are solving.
âšī¸ About this TIL snippet: Created 2023-03-31T21:18:21-04:00 · View the source