Kubernetes CKA sample exam question 32 with answer

Question
Write the information about nodes and their taints into file CKAC0046.txt.
The output format:

{"name": "name_value".
 "taints": "taint_value"}
Answer
For this - jq tool is needed:
kubectl get nodes -o json | jq ".items[]|{name:.metadata.name, taints:.spec.taints}"
This will output in format described above.
Redirect to a file:
kubectl get nodes -o json | jq ".items[]|{name:.metadata.name, taints:.spec.taints}" > CKAC0046.txt
Check:
cat CKAC0046.txt