Post

kubectl sort by

Kubernetes: kubectl sort by — configuration and practical examples.

Use the --sort-by flag with a JSONPath expression to sort kubectl output by any field. This example sorts pods in the prod namespace by the node they are scheduled on.

1
kubectl get pods -o wide -n prod --sort-by=.spec.nodeName
This post is licensed under CC BY 4.0 by the author.