@tank/kubectl-cheatsheet
1.0.0Description
Kubectl command cheat sheet covering read, debug, rollout, mutation, selectors, output formatting, and common Kubernetes operator tasks.
Triggered by
kubectlkubectl cheat sheetkubectl commandskubectl logskubectl exec
Download
Verified
tank install @tank/kubectl-cheatsheetKubectl Cheat Sheet
Core Philosophy
- Optimize for the command you need right now — Cheat sheets should get you to the right command quickly, not explain Kubernetes from first principles.
- Group by operational task, not alphabetically — Operators think in “inspect pods” and “roll out a deployment,” not in raw verb order.
- Prefer safe read commands first —
get,describe,logs, anddiffshould come before write actions when debugging. - Make selectors and namespaces explicit — Most kubectl mistakes come from targeting the wrong objects or cluster scope.
- Include output shaping —
-o wide,-o yaml,jsonpath, and label selectors often matter as much as the base command.
Quick-Start: Common Problems
"What pods are broken right now?"
kubectl get pods -Akubectl describe pod <pod> -n <ns>kubectl logs <pod> -n <ns> --previous-> Seereferences/commands.md
"How do I restart or roll out a deployment?"
| Need | Command |
|---|---|
| restart deployment | kubectl rollout restart deploy/<name> -n <ns> |
| watch rollout status | kubectl rollout status deploy/<name> -n <ns> |
| scale replicas | kubectl scale deploy/<name> --replicas=3 -n <ns> |
-> See references/commands.md |
Decision Trees
| Signal | Command family |
|---|---|
| need to inspect objects | get, describe, logs, top |
| need to enter or reach workload | exec, port-forward |
| need to change desired state | apply, delete, scale, rollout |
| need filtered output | selectors, -o, jsonpath |
Reference Index
| File | Contents |
|---|---|
references/commands.md | kubectl commands grouped by inspect, debug, mutate, rollout, output shaping, namespaces, resources, and common operator tasks |