Kubectl Context Commands

By default, the kubectl command for Kubernetes uses parameters from the current context to communicate with the cluster.

Display the current context:

$ kubectl config current-context

List all contexts in a kubeconfig file:

$ kubectl config get-contexts

Switch context:

$ kubectl config use-context <context_name>

Comments