Inventory every Kubernetes deployment and container image
Build a paste-ready command, then review its compatibility and effects before running it.
kubectl get deployments -A -o json | jq -r '.items[] | .metadata as $m | .spec.template.spec.containers[] | [$m.namespace,$m.name,.name,.image] | @tsv' | sortCompatibility
Linux + macOS + WindowsVerified for Linux, macOS, Windows using bash, zsh, powershell syntax.
Operational knowledgereview due 2027-01-19
Requirementskubectlkubectl must be installed and available on PATH.Network accessThe target must be reachable from the current environment.
Version supportkubectl Current supported releasesVerified for linux, macos, windows using bash, zsh, powershell syntax; consult compatibility notes for platform-specific differences.
Expected signalsdefault api api registry.example.com/api:2026.07Representative successful output; values vary with the selected target and system state.
Known errorskubectl: command not foundkubectl is missing or is not available on PATH.
Verifykubectl get deployments -A -o json | jq -r '.items[] | .metadata as $m | .spec.template.spec.containers[] | [$m.namespace,$m.name,.name,.image] | @tsv' | sortThe output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01kubectlCommandRuns the kubectl stage of this one-liner.
02getArgumentPasses get to kubectl.
03deploymentsArgumentPasses deployments to kubectl.
04-AOptionConfigures kubectl with the -A option.
05-oOptionSelects an output file or output format for this command.
06jsonArgumentPasses json to kubectl.
07|PipelinePasses the output on the left to the command on the right.
08jqCommandRuns the jq stage of this one-liner.
09-rOptionEnables raw, recursive, or reverse mode for this command.
10'.items[] | .metadata as $m | .spec.template.spec.containers[] | [$m.namespace,$m.name,.name,.image] | @tsv'ArgumentPasses '.items[] | .metadata as $m | .spec.template.spec.containers[] | [$m.namespace,$m.name,.name,.image] | @tsv' to jq.
11|PipelinePasses the output on the left to the command on the right.
12sortCommandRuns the sort stage of this one-liner.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
kubectl get deployments -A -o json | jq -r '.items[] | .metadata as $m | .spec.template.spec.containers[] | [$m.namespace,$m.name,.name,.image] | @tsv' | sort
Example output
default api api registry.example.com/api:2026.07
payments worker worker registry.example.com/worker:4.8.1
Illustrative output — exact values vary by system and data.
Official sources