Skip to content

Pod

Get Pod Image

bash
kubectl get po xxx -o jsonpath="{.items[*].spec['containers'][*].image}{'\n'}"; echo

List All Images

All Images = Containers Images + Init Containers Images

All Images
bash
kubectl get pods -o jsonpath="{.items[*].spec['containers', 'initContainers'][*].image}" | \
tr -s '[[:space:]]' '\n' |\
sort |\
uniq
containers only
bash
kubectl get pods -o jsonpath="{.items[*].spec['containers'][*].image}" | \
tr -s '[[:space:]]' '\n' |\
sort |\
uniq
initContainers only
bash
kubectl get pods -o jsonpath="{.items[*].spec['initContainers'][*].image}" | \
tr -s '[[:space:]]' '\n' |\
sort |\
uniq