kubectl Cheat Sheet: Commands for Everyday Kubernetes
The kubectl commands you run every day, plus the debugging ones you need under pressure.
Inspect, apply, roll out, and debug - the kubectl essentials.
Inspect
| Command | Does |
|---|---|
| kubectl get pods -A | All pods, all namespaces |
| kubectl describe pod NAME | Pod details + events |
| kubectl logs -f NAME | Follow logs |
| kubectl get events --sort-by=.lastTimestamp | Recent events |
| kubectl top pods | CPU/memory usage |
Apply & rollout
| Command | Does |
|---|---|
| kubectl apply -f file.yaml | Apply manifest |
| kubectl rollout status deploy/NAME | Wait for rollout |
| kubectl rollout undo deploy/NAME | Roll back |
| kubectl scale deploy/NAME --replicas=3 | Scale |
Debug
| Command | Does |
|---|---|
| kubectl exec -it NAME -- sh | Shell into a pod |
| kubectl describe node NAME | Node pressure/taints |
| kubectl get pod NAME -o yaml | Full pod spec |
| kubectl config current-context | Active cluster |
Related guides
Docker Cheat Sheet: Commands, Dockerfile & ComposeA Docker cheat sheet - build, run, images, volumes, networks, Dockerfile instructions, and compose commands f…
Helm Cheat Sheet: Charts, Releases & UpgradesA Helm cheat sheet - install, upgrade, rollback, template, repo, and dependency commands for managing Kuberne…