Skip to content

Instantly share code, notes, and snippets.

@dmusicant-dk
Created January 20, 2021 23:04
Show Gist options
  • Save dmusicant-dk/b6ac1428c2a9e607d411040fd7a6403e to your computer and use it in GitHub Desktop.
Save dmusicant-dk/b6ac1428c2a9e607d411040fd7a6403e to your computer and use it in GitHub Desktop.
Using K8s Clusters vs Contexts
# Find out the contexts you've configured and which is the default
# (will be the one with the asterisk)
kubectl config get-contexts
# Get detailed info on a specified cluster
kubectl cluster-info dump --context=minikube
# Set cluster for a specific command
export CLUSTER=minikube
kubectl cluster-info dump --context=${CLUSTER}
# Set kubectl to use a specific context for all commands
kubectl config use-context minikube
kubectl cluster-info dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment