Kubernetes CKA sample exam question 106 with answer

Question
List all container images of all pods running in all namespaces and save the output to /tmp/container-images.txt

Answer
You can accomplish this with range-end:

kubectl get pods -A -o=jsonpath='{range .items[*]}{range .spec.containers[*]}{.image}{"\n"}{end}{end}'