Switch kubeconfig context kubectl
Switch the active cluster context
kubectl config use-context <context>
more kubectl
all 73 commands →
List kubeconfig contexts
kubectl config get-contexts
Merge kubeconfigs
KUBECONFIG=~/.kube/config:~/.kube/cluster2.yaml kubectl config view --flatten > ~/.kube/merged.yaml
Set default namespace for context
kubectl config set-context --current --namespace=<ns>
Get cluster info
kubectl cluster-info
Get node conditions
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{": "}{range .status.conditions[*]}{.type}={.status},{" "}{end}{"\n"}{end}'