Stage 2, Part 9 of 9 · p. 18, kubectl Mastery & Debugging

Summary Cheat Sheet

ConceptKey Takeaway
kubectlClient that talks to API server via REST
kubeconfigConfig file with clusters/users/contexts
Contextcluster + user + namespace
Imperativekubectl run, create, set, scale
Declarativekubectl apply
Apply 3-way mergelast-applied + new + live
Server-side applyBetter than client-side, used by GitOps
-o jsonpathExtract specific fields
-o custom-columnsCustom table output
-o yamlFull resource
kubectl describeHuman-readable + Events
EventsCluster notifications, last ~1 hour
kubectl debugEphemeral containers for distroless
kubectl patchModify specific fields
kubectl diffPreview changes
CrashLoopBackOffApp crashing → check logs --previous
ImagePullBackOffImage problem → check Events
PendingScheduling problem → check describe Events
OOMKilledMemory limit → increase or fix leak
No endpointsSelector mismatch

1:1 copy of the class Google Doc, code in code blocks.