Get current image of kubernetes deployment

From kubectl 1.6 the -o wide option does this, so

kubectl get deployments -o wide

will show the current image in the output.


You can use kubectl's jsonpath output option to achieve this:

kubectl get deployment flags -o=jsonpath='{$.spec.template.spec.containers[:1].image}'

to get just the image uri for all pods (in all namespaces, for example):

kubectl get pods --all-namespaces -o jsonpath="{..image}"

(see https://kubernetes.io/docs/tasks/access-application-cluster/list-all-running-container-images/ for more detail)