← Cheat Sheets
Kubernetes kubectl Commands
Inspect and manage cluster resources.
# Kubernetes kubectl Commands
Inspect and manage cluster resources.
```bash
kubectl get pods -n my-namespace
kubectl get deploy,svc,nodes
kubectl describe pod <pod>
kubectl logs -f <pod> [-c container]
kubectl exec -it <pod> -- sh
kubectl apply -f manifest.yaml
kubectl delete -f manifest.yaml
kubectl rollout status deploy/<name>
kubectl rollout undo deploy/<name>
kubectl scale deploy/<name> --replicas=3
kubectl port-forward svc/<name> 8080:80
kubectl config get-contexts
kubectl config use-context <name>
kubectl top pods
kubectl explain pod.spec.containers
```