diff --git a/content/en/docs/reference/kubectl/cheatsheet.md b/content/en/docs/reference/kubectl/cheatsheet.md index 19a0b78f4f..10e5b140ef 100644 --- a/content/en/docs/reference/kubectl/cheatsheet.md +++ b/content/en/docs/reference/kubectl/cheatsheet.md @@ -158,6 +158,10 @@ kubectl get services --sort-by=.metadata.name # List Services Sorted by Name # List pods Sorted by Restart Count kubectl get pods --sort-by='.status.containerStatuses[0].restartCount' +# List pods in test namespace sorted by capacity + +kubectl get pods -n test --sort-by=.spec.capacity.storage + # Get the version label of all pods with label app=cassandra kubectl get pods --selector=app=cassandra -o \ jsonpath='{.items[*].metadata.labels.version}'