List events sorted by time
Recent cluster events, oldest first; handy for a post-incident review
kubectl get events -A --sort-by='.lastTimestamp'
More kubectl commands
-
kubectl apply --server-side --dry-run=server -f file.yamlChecks the manifest against the live API server without changing anything
-
kubectl get deployment/<name> -n <ns> -o yamlCurrent state of the resource without managedFields; a good base for a new manifest
-
kubectl delete pod <name> -n <ns> --grace-period=0 --forceRemoves a pod stuck in Terminating right away; use with care
-
kubectl cp <ns>/<pod>:/remote/path ./local-pathCopies a file from a running container to your machine
-
kubectl cordon <node>Marks the node as unschedulable, so no new pods start there