Skip to content

Kubernetes Cheat Sheet

Scannable commands and patterns for the Kubernetes track. Prefer the full tutorials when you need why, not only how.

Quick reference

Area Commands / notes
Context kubectl config get-contexts; kubectl cluster-info
Get kubectl get pods -A; -o wide; -w
Describe kubectl describe pod NAME; Events section first
Logs kubectl logs deploy/NAME -f; --previous
Apply kubectl apply -f; diff -f; delete -f
Workloads Deployment, StatefulSet, DaemonSet, Job/CronJob
Expose Service ClusterIP/NodePort/LB; Ingress
Config ConfigMap / Secret; envFrom; mounts
Rollout kubectl rollout status; undo; restart
Debug kubectl get events --sort-by=.lastTimestamp

Common mistakes

  • Copy-pasting without reading expected output
  • Skipping cleanup (leftover containers, state, or temp files)
  • Mixing production credentials into lab shells