kubectl config get-contexts

Category: Kubernetes & Containers

kubectl config get-contexts

List all kubeconfig contexts

Shows every context defined in your kubeconfig (the file that maps cluster addresses to credentials), with an asterisk marking the current one. Contexts bundle a cluster, user, and namespace. Switch with kubectl config use-context prod.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.