Skip to content

Instantly share code, notes, and snippets.

@gswallow
Last active May 21, 2020 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gswallow/4f79f9a841cfd689b258a938351ec4c0 to your computer and use it in GitHub Desktop.
Save gswallow/4f79f9a841cfd689b258a938351ec4c0 to your computer and use it in GitHub Desktop.
# Amazon EKS
aws eks update-kubeconfig --name whatever-its-called \
--dry-run --alias my-cluster > $HOME/.kube/config.d/my-cluster
rehash
# Azure Kubernetes Service
az aks get-credentials --name whatever-its-called \
--resource-group my-resource-group --context my-aks-cluster \
> $HOME/.kube/config.d/my-aks-cluster
rehash
# Google GKE cli just barfs whatever it wants into $KUBECONFIG
KUBECONFIG=$HOME/.kube/config.d/my-gke-cluster \
gcloud container clusters get-credentials \
--region us-central1 whatever-its-called
yq w -i $HOME/.kube/config.d/my-gke-cluster 'contexts[0].name' my-gke-cluster
rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment