Kubernetes CKA sample exam question 132 with answer

Question
Generate a file CKA132.txt with details about the size of all nodes in Kubernetes cluster using custom columns, in the following format:

NAME	AVAILABLE_MEMORY	AVAILABLE_CPU
control	...			...
node01	...			...
Answer
Get nodes in json format:
kubectl get no -o json
Note down the fields with required information. They are .status.capacity.cpu and .status.capacity.memory. Construct the query using custom columns:
kubectl get no -o custom-columns=NAME:.metadata.name,AVAILABLE_MEMORY:.status.capacity.memory,AVAILABLE_CPU:.status.capacity.cpu
Redirect to a file CKA132.txt:
kubectl get no -o custom-columns=NAME:.metadata.name,AVAILABLE_MEMORY:.status.capacity.memory,AVAILABLE_CPU:.status.capacity.cpu > CKA132.txt