incorrect command for sort-by operation on pod (#17032)

* incorrect command for sort-by

kubectl get pods -n test --sort-by=.spec.capacity.storage, is incorrect for pod as pods will not have capacity.storage under .spec, rather it should be for PersistentVolume.

So change the command  

kubectl get pv -n test --sort-by=.spec.capacity.storage

* Update cheatsheet.md
This commit is contained in:
praveen-kg 2019-11-26 06:29:10 +01:00 committed by Kubernetes Prow Robot
parent 6551689040
commit e26dd31892
1 changed files with 2 additions and 2 deletions

View File

@ -160,9 +160,9 @@ kubectl get services --sort-by=.metadata.name
# List pods Sorted by Restart Count
kubectl get pods --sort-by='.status.containerStatuses[0].restartCount'
# List pods in test namespace sorted by capacity
# List PersistentVolumes in test namespace sorted by capacity
kubectl get pods -n test --sort-by=.spec.capacity.storage
kubectl get pv -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 \