Kubernetes CKA sample exam question 90 with answer

Question
List all nodes sorted by CPU capacity and store the output in /tmp/nodes-capacity.txt

Answer
It is pretty simple:

kubectl get nodes -o json
kubectl get nodes --sort-by=.status.capacity.cpu
kubectl get nodes --sort-by=.status.capacity.cpu > /tmp/nodes-capacity.txt