Cheat Sheet
The commands you keep forgetting, with a one-line description and a real example you can copy - 384 across 26 tools. Pick a tool in the sidebar, or search across all of them.
kubectl
Day-to-day commands for inspecting and steering a Kubernetes cluster.| Command | What it does | Example |
|---|---|---|
kubectl get pods | List pods in the current namespace. | kubectl get pods |
kubectl get all | List the main resources in a namespace. | kubectl get all -n default |
kubectl get -o wide | Show extra columns like node and IP. | kubectl get pods -o wide |
kubectl describe | Show details and recent events for a resource. | kubectl describe pod web-7d9f |
kubectl logs | Print (and follow) a pod’s logs. | kubectl logs -f web-7d9f |
kubectl exec | Open a shell inside a pod. | kubectl exec -it web-7d9f -- sh |
kubectl apply | Create or update resources from a manifest. | kubectl apply -f deployment.yaml |
kubectl delete | Delete a resource. | kubectl delete pod web-7d9f |
kubectl scale | Change the number of replicas. | kubectl scale deploy/web --replicas=3 |
kubectl rollout status | Watch a deployment roll out. | kubectl rollout status deploy/web |
kubectl rollout undo | Roll back to the previous version. | kubectl rollout undo deploy/web |
kubectl port-forward | Forward a local port to a service. | kubectl port-forward svc/web 8080:80 |
kubectl top | Show CPU/memory usage. | kubectl top pods |
kubectl get ns | List namespaces. | kubectl get namespaces |
kubectl config use-context | Switch the cluster you are talking to. | kubectl config use-context prod |
kubectl edit | Edit a live resource in your editor. | kubectl edit deploy/web |