Exec command in all pods kubectl
Run a command in every pod matching a label selector
kubectl get pods -n <ns> -l app=<label> -o name | xargs -I{} kubectl exec {} -n <ns> -- <cmd>
more kubectl
all 73 commands →
Watch pod status changes
kubectl get pods -n <ns> -w
Top pods by CPU
kubectl top pods -A --sort-by=cpu
Create ServiceAccount token
kubectl create token <sa-name> -n <ns> --duration=1h
Check who can do what (audit)
kubectl auth can-i --list -n <ns>
Delete all pods in namespace
kubectl delete pods --all -n <ns>