Show Warning events in all namespaces
Cluster-wide Warning events, newest last; a fast way to find failing workloads
kubectl get events -A --field-selector type=Warning --sort-by=.lastTimestamp
- tool
- kubectl73 commands
More kubectl commands
-
kubectl get pods -A --field-selector status.phase=FailedLists pods in the Failed phase in all namespaces, for cleanup or investigation
-
kubectl wait --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' svc/<name> -n <ns> --timeout=120sWaits in CI until a Service gets an external IP; works with any jsonpath field
-
kubectl auth can-i list secrets -n <ns> --as=<name> --as-group=system:serviceaccountsTests RBAC as another identity without their kubeconfig; you need the impersonate verb
-
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.status.containerStatuses[0].restartCount}{"\n"}{end}' | sort -k3 -rn | headShows the pods that restart most often, to catch crashloops fast
-
kubectl get nodes -o json | jq -r '.items[] | {node:.metadata.name, capCPU:.status.capacity.cpu, allocCPU:.status.allocatable.cpu, capMem:.status.capacity.memory, allocMem:.status.allocatable.memory}'Shows the reserved overhead on each node; the gap is kube and system reservations