Merge kubeconfigs kubectl
Combine multiple kubeconfig files into one
KUBECONFIG=~/.kube/config:~/.kube/cluster2.yaml kubectl config view --flatten > ~/.kube/merged.yaml
more kubectl
all 73 commands →
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>
Wait for pod ready
kubectl wait pod -l app=<label> -n <ns> --for=condition=Ready --timeout=120s