Switch kubeconfig context
Switch the active cluster context
kubectl config use-context <context>
More kubectl commands
-
kubectl config get-contextsShow all contexts in current kubeconfig
-
KUBECONFIG=~/.kube/config:~/.kube/cluster2.yaml kubectl config view --flatten > ~/.kube/merged.yamlCombine multiple kubeconfig files into one
-
kubectl config set-context --current --namespace=<ns>Avoid typing -n on every command for this context
-
kubectl cluster-infoShow API server and CoreDNS endpoints
-
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{": "}{range .status.conditions[*]}{.type}={.status},{" "}{end}{"\n"}{end}'Show all conditions per node (Ready, MemoryPressure, DiskPressure)