Pod Commands¶
Commands for managing and viewing Kubernetes pods.
List Pods¶
Flags¶
Flag | Short | Description | Default |
---|---|---|---|
--namespace |
-n |
Target namespace | default |
--all-namespaces |
-A |
List across all namespaces | false |
--selector |
-l |
Label selector | - |
--status |
-s |
Filter by status | - |
--sort |
- | Sort by (age|name|status) | - |
--reverse |
- | Reverse sort order | false |
--metrics |
- | Show CPU/Memory usage | false |
Examples¶
List pods in default namespace:
List pods across all namespaces:
Filter pods by label:
Filter by status:
Sort pods:
k8stool get pods --sort age # Sort by age (oldest first)
k8stool get pods --sort age --reverse # Sort by age (newest first)
k8stool get pods --sort name # Sort by name
k8stool get pods --sort status # Sort by status
Show resource usage:
Output¶
The output includes:
- Pod name
- Ready status (running containers/total containers)
- Status (color-coded)
- Running: Green
- Pending: Yellow
- Failed: Red
- Age (smart formatting)
- CPU usage (if --metrics flag is used)
- Memory usage (if --metrics flag is used)
- Namespace (when listing across namespaces)
Example output:
NAME READY STATUS AGE CPU MEMORY
nginx-6799fc88d8-abc12 1/1 Running 5d6h 10m 128Mi
redis-7d8594697c-def34 1/1 Running 2h30m 50m 256Mi
Related Commands¶
- Logs: View pod logs
- Port Forward: Forward ports to pods
- Exec: Execute commands in pods
- Events: View pod events
- Describe: Get detailed pod information