1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| # List pods
kubectl get pods -A # All namespaces
kubectl get po -A # Short form
kubectl get pods -n kube-system # Specific namespace
kubectl get pods -o wide # Detailed pod information
kubectl get pods --watch # Watch pod status changes
kubectl get pods -l label_name # Filter pods by label
# Pod management
kubectl logs -f pod_name # Follow pod logs
kubectl logs pod_name # View pod logs
kubectl exec -it pod_name -- /bin/sh # Shell into pod
kubectl delete pods pod_name # Delete pod
kubectl edit pod pod_name # Edit pod configuration
kubectl cp pod_name:/src/path local_path # Copy from pod
|