Page MenuHomePhabricator
Paste P14374

kubectl
ActivePublic

Authored by JMeybohm on Tue, Feb 16, 12:07 PM.
# List all images (without registry) running in the cluster
kubectl get pods --all-namespaces --field-selector=status.phase=Running -o jsonpath="{..image}" | tr ' ' '\n' | sed 's/.*\///' | sort -u
# List images used per namespace
kubectl get pods --all-namespaces --field-selector=status.phase=Running -o=jsonpath='{range .items[*]}{"\n"}{.metadata.namespace}{":\t"}{range .spec.containers[*]}{.image}{", "}{end}{end}'