Cheatsheet Pages / kubectl Cheatsheet

How to switch Kubernetes clusters — kubectl config use-context

You need to run commands against a different cluster than the current one.

Placeholders follow the cheatsheet: web is a deployment/pod name and app.yaml is your manifest. Most commands act on the current namespace — add -n <ns> to target another one.

kubectl config use-context prod-cluster   # ⚠️ double-check before running prod commands

Good to know

Double-check the context before running production commands.

kubectl Cheatsheet one-page card — commands that actually work
The full one-page card — kubectl Cheatsheet. Get the complete cheatsheet on GitHub