All Shortcuts

Kubernetes (kubectl) Shortcuts & Commands — Complete Cheat Sheet (17)

Complete kubectl commands cheat sheet for Kubernetes cluster management. Covers pod operations, deployments, services, contexts, and namespace management.

Related Shortcut Pages

Docker npm / yarn AWS CLI PowerShell tmux GNU Screen

Search all Kubernetes (kubectl) shortcuts interactively

Interactive Shortcut Finder

All Kubernetes (kubectl) Shortcuts

View Resources

ShortcutActionDescription
kubectl get podsList podsList pods in current namespace.
kubectl get svcList servicesList services.
kubectl get nodesList nodesList cluster nodes.
kubectl get allAll resourcesList all resources.
kubectl describe pod [name]Pod detailsShow detailed pod information.
kubectl logs [pod]View logsView pod logs.
kubectl logs -f [pod]Follow logsFollow pod logs in real time.

Manage Resources

ShortcutActionDescription
kubectl apply -f [file]Apply resourceCreate/update resources from YAML.
kubectl delete pod [name]Delete podDelete a pod.
kubectl scale deploy [name] --replicas=3ScaleChange deployment replica count.
kubectl exec -it [pod] -- bashEnter podOpen bash shell inside a pod.
kubectl port-forward [pod] 8080:80Port forwardForward local port to pod port.
kubectl rollout restart deploy [name]Rolling restartRolling restart a deployment.

Context & Namespace

ShortcutActionDescription
kubectl config get-contextsList contextsShow available contexts.
kubectl config use-context [name]Switch contextSwitch to another cluster context.
kubectl get nsList namespacesList namespaces.
kubectl -n [NS] get podsSpecify namespaceQuery resources in specific namespace.

Frequently Asked Questions

📄 View Printable Cheat Sheet — Download as PDF or print · 🧩 Combine with other tools

How do I list all pods in Kubernetes?

Use 'kubectl get pods' for the current namespace, or 'kubectl get pods --all-namespaces' for all namespaces.

How do I get a shell inside a running pod?

Use 'kubectl exec -it pod-name -- /bin/bash' to open an interactive shell.

How do I view pod logs in Kubernetes?

Use 'kubectl logs pod-name' for logs, add '-f' to follow, or '--previous' for logs from a crashed container.

How do I scale a deployment?

Use 'kubectl scale deployment name --replicas=3' to change the number of pod replicas.

What View Resources shortcuts does Kubernetes (kubectl) have?

Kubernetes (kubectl) includes 7 View Resources shortcuts, including kubectl get pods (List pods) and kubectl get svc (List services). See the full list in the View Resources section above.

What Manage Resources shortcuts does Kubernetes (kubectl) have?

Kubernetes (kubectl) includes 6 Manage Resources shortcuts, including kubectl apply -f [file] (Apply resource) and kubectl delete pod [name] (Delete pod). See the full list in the Manage Resources section above.

Can I combine Kubernetes (kubectl) shortcuts with other tools?

Yes — use My Stack to combine Kubernetes (kubectl) shortcuts with any other platform on this site into one printable reference, which is useful if your daily workflow spans several tools.

Browse shortcuts for 269 platforms

Explore All
🔧 Spotted an error or a missing shortcut? Suggest an edit on GitHub — every accepted fix goes live on this page, the API and the CLI.

🤖 Ask AI about Kubernetes (kubectl) shortcuts

Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"

ChatGPT Claude Perplexity Gemini Grok