Kubernetes CKA sample exam question 74 with answer

Question
List pods Sorted by Restart Count.
List PersistentVolumes sorted by capacity.
List Services Sorted by Name

Answer
First task solution could be found in Kubernetes documentation in kubectl cheatsheet:

kubectl get pods -A --sort-by='.status.containerStatuses[0].restartCount'
Second task - same:
kubectl get pv --sort-by='.spec.capacity.storage'
Third task:
kubectl get svc -A --sort-by='.metadata.name'