kubectl get pods
kubectl get pods -n kube-system
kubectl get pods -A # all namespaces
kubectl get pods -o wide # show node and IP
kubectl get pod my-pod -o yaml # full manifest
kubectl get all # pods, services, deployments
kubectl get nodes
kubectl get events --sort-by=.lastTimestamp
# Ephemeral debug container (Kubernetes 1.23+)
kubectl debug -it my-pod --image=busybox --target=app
# Run a temporary pod in the same network
kubectl run debug --image=nicolaka/netshoot --rm -it --restart=Never
# Copy files from a pod
kubectl cp my-pod:/var/log/app.log ./app.log
kubectl label pod my-pod env=prod
kubectl get pods -l env=prod
kubectl get pods -l 'env in (prod,staging)'
kubectl annotate pod my-pod description="my app"