Skip to main content

Pod


Get Pod Image

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

List All Images

All Images = Containers Images + Init Containers Images

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