Skip to content

@tank/kubectl-cheatsheet

1.0.0

Description

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-cheatsheet

Kubectl Cheat Sheet

Core Philosophy

  1. Optimize for the command you need right now — Cheat sheets should get you to the right command quickly, not explain Kubernetes from first principles.
  2. Group by operational task, not alphabetically — Operators think in “inspect pods” and “roll out a deployment,” not in raw verb order.
  3. Prefer safe read commands firstget, describe, logs, and diff should come before write actions when debugging.
  4. Make selectors and namespaces explicit — Most kubectl mistakes come from targeting the wrong objects or cluster scope.
  5. 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?"

  1. kubectl get pods -A
  2. kubectl describe pod <pod> -n <ns>
  3. kubectl logs <pod> -n <ns> --previous -> See references/commands.md

"How do I restart or roll out a deployment?"

NeedCommand
restart deploymentkubectl rollout restart deploy/<name> -n <ns>
watch rollout statuskubectl rollout status deploy/<name> -n <ns>
scale replicaskubectl scale deploy/<name> --replicas=3 -n <ns>
-> See references/commands.md

Decision Trees

SignalCommand family
need to inspect objectsget, describe, logs, top
need to enter or reach workloadexec, port-forward
need to change desired stateapply, delete, scale, rollout
need filtered outputselectors, -o, jsonpath

Reference Index

FileContents
references/commands.mdkubectl commands grouped by inspect, debug, mutate, rollout, output shaping, namespaces, resources, and common operator tasks

Command Palette

Search skills, docs, and navigate Tank