Question
List all deployments running in ALL namespaces. ONLY display deployment name, namespace name and image name of the FIRST container. Save the output to /tmp/all-deployments.txt
Output should look similar to the sample shown below:
NAME NAMESPACE IMAGE_NAME
app1 default nginx
Answerkubectl get deployments -A -o=custom-columns=NAME:.metadata.name,NAMESPACE:.metadata.namespace,IMAGE:.spec.template.spec.containers[0].image > /tmp/all-deployments.txt