Skip to content

Instantly share code, notes, and snippets.

@niklaskeerl
Created January 25, 2023 09:59
Show Gist options
  • Save niklaskeerl/7d956b3629b71ca091ed25324b700851 to your computer and use it in GitHub Desktop.
Save niklaskeerl/7d956b3629b71ca091ed25324b700851 to your computer and use it in GitHub Desktop.
Get kubeconfig for gcloud gke cluster
# List all gcloud projects
gcloud projects list
# Set Project ID from project list
gcloud config set project $PROJECT_ID
# List all cluster names and zones for this project ID
gcloud container clusters list
# Generate kubeconfig entry
gcloud container clusters get-credentials --zone $LOCATION $NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment