Kubernetes CKA sample exam question 116 with answer

Question
List all the pods running in ALL namespaces in following format and save the file to /tmp/all-pods.txt:

POD_NAME NAMESPACE NODE_NAME
Answer
This is another example of custom columns.
It is very important to practice these commands not just for CKA exam but also for day to day operations:
kubectl get pods -A -o=custom-columns=POD_NAME:.metadata.name,NAMESPACE:.metadata.namespace,NODE_NAME:.spec.nodeName > /tmp/all-pods.txt