Set default namespace for context kubectl
Avoid typing -n on every command for this context
kubectl config set-context --current --namespace=<ns>
more kubectl
all 73 commands →
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
Scrape apiserver metrics endpoint
kubectl get --raw /metrics | grep apiserver_request_total