Skip to main content
kitlocal.dev

kubectl Cheatsheet

Runs locally

100% processed in your browser. Inputs and outputs never leave your device.

Kubernetes CLI commands for inspecting pods, deployments, services, logs, exec debugging, rollouts, contexts, and JSONPath queries on Kubernetes 1.30+.

How it works

kubectl reads and reconciles declarative resource manifests against the API server: `get`/`describe`/`logs` diagnose state, while `apply`/`rollout` safely drive cluster changes.

Survival kit

The few commands to learn first.

42 commands

Keyboard shortcuts/Focus searchJKMove selectionCCopy selectedFBookmark selectedEscClear search

Contexts, Namespaces & Discovery

Verify which cluster and namespace you target before reading or changing state.

  • Essential

    Print the currently active cluster context before running commands

    kubectl config current-context

    When to use it

    Prevents accidentally running dev commands against a production cluster.

    Example

    kubectl config current-context

Inspect, Logs & Events

Diagnose CrashLoopBackOff, ImagePullBackOff, pending pods, and probe failures.

Shell, Port-Forward & Copy

Connect to cluster services locally, exec into pods, and transfer files.

Apply, Dry-Run & Rollouts

Validate manifests safely, watch rollouts, scale, and roll back cleanly.

Nodes, RBAC & Cleanup

Verify permissions, check resource usage, cordon nodes, and clean pods.

Try it in a KitLocal tool

Checked on Nov 15, 2026 · Checked against Kubernetes 1.30+ kubectl CLI

Sources: Kubernetes kubectl Reference · kubectl Quick Reference

Replace anything in angle brackets with your own values. Commands come from the official documentation, and examples were run on the version shown.