JSONPath prints fields. Custom columns print them as a table, and --sort-by and --field-selector decide the rows.
Your own table
kubectl get pods -o custom-columns=NAME:.metadata.name,NODE:.spec.nodeName,IMAGE:.spec.containers[0].imageNAME NODE IMAGE
market-api-7b6c-x2k4p shallows-node-1 stackmonsters/monster-market-api:v2
market-db-5f7d-m2k8q shallows-node-1 postgres:16Each HEADER:path pair is a column; the path is a JSONPath without braces. Any field in -o yaml can be a column, which is how you get a table of QoS classes, restart counts or images without a loop.
Sorting
kubectl get pods --sort-by=.metadata.creationTimestamp
kubectl get pods --sort-by=.status.containerStatuses[0].restartCount
kubectl get events --sort-by=.lastTimestamp--sort-by takes a JSONPath and sorts ascending, so the newest Pod or the worst restarter is at the bottom. It combines with any output format, including custom columns.
Filtering by field
kubectl get pods -A --field-selector status.phase=Running
kubectl get pods --field-selector status.phase!=Running
kubectl get events --field-selector type=WarningLabels are matched with -l. A few fields can be matched too: metadata.name, metadata.namespace, status.phase, spec.nodeName on Pods, type and reason on Events. The filter runs on the server, so it also works for large clusters.
Output for other commands
kubectl get pods -o name
kubectl get pods --field-selector status.phase=Failed -o name | xargs kubectl delete-o name prints pod/market-api-7b6c-x2k4p, one per line, the exact token other kubectl commands accept. It is the glue between a question and an action.