Skip to content

List All Container Images Running in a Cluster #27475

Description

@BahmaniAlireza

Hi,

I've tested this example :

      kubectl get pods --all-namespaces -o jsonpath="{..image}" |\
      tr -s '[[:space:]]' '\n' |\
      sort |\
      uniq -c

It returns image names double, because "{..image}" recursively search in the output of JSON, So at the first, it will find the "image" word in "spec.containers.image" and at the second time, it will find the "image" word in "containerStatuses.image".
It means you will see the image name two times for each pod at least.

Please change your example.

Best Regards,
Alireza Bahmani.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions