List kubeconfig contexts kubectl
Show all contexts in current kubeconfig
kubectl config get-contexts
more kubectl
all 73 commands →
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}'
Trigger CronJob manually
kubectl create job --from=cronjob/<name> manual-run -n <ns>