Cheatsheet Pages / kubectl Cheatsheet

How to set a default namespace and stop typing -n — kubectl config set-context

You type -n dev on every single command and want your default namespace pinned instead.

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 set-context --current --namespace=dev   # stop typing -n dev on every command
kubectl Cheatsheet one-page card — commands that actually work
The full one-page card — kubectl Cheatsheet. Get the complete cheatsheet on GitHub