List of images on a node: kubectk get no -i json missing some images

Hi,

i’m trying to list images of a node in the same way docker images does.

Following a hint on StackOverflow I thought kubectl get node -o json would be the solution, but I see that there are pods that are not listed there.
First question: is it correct? shouldn’t the output show all images on the node?

Note I’m working on a single node test environment, so no possibility that the image is in another node.

On official docs I see that they always start from pods, to get the images. That’s partly ok but it will not show all images that are no longer used.

Is there an equivalent of docker images?
Is there an equivalent of docker system prune?

You can do kubectl get po -A to get all the images on a node. No, kubectl doesn’t have a command similar to docker system prune.

Kubectl get pods -A 

will list all pods from all namespaces (assuming you have the right role assigned to your user).

I am not aware of a kubectl command to get all images from a node.

In order to prune images you should use the GC (garbage collection) feature (Garbage Collection | Kubernetes). And tweak the thresholds.

1 Like

Thanks a lot. I was unaware of this. I’ll have a look at it.

Nevertheless, I’m wondering: what do you get when you run kubectl get no -o json?
why do most of the images appear there but some do not?

1 Like

My guess would be update interval of kubelet…but I never dove into it

do I understand correctly that if it was simply update interval that would change with time… the situation is just the same since 5 days.

Just to show what I men:

adk-b1-staging:/home/share/setup-cluster # kubectl get -n adk pod adk-vuejs-5d9d444dfd-nmz6b -o json |jq '.spec.containers[].image'
"registry.thux.dev/customers/adk/quasar-test:topic-default-staging"
adk-b1-staging:/home/share/setup-cluster # kubectl get no -o json|grep quasar
adk-b1-staging:/home/share/setup-cluster #                                            

No images for this pod are listed by kubectl get no -i json

adk-b1-staging:/home/share/setup-cluster # kubectl get -n adk pod adk-django-5cfc54df58-ntdh6  -o json |jq '.spec.containers[].image'
"registry.thux.dev/customers/adk/office2018.adk.com:topic-default-fake-production"
adk-b1-staging:/home/share/setup-cluster # kubectl get no -o json|grep django
adk-b1-staging:/home/share/setup-cluster # kubectl get no -o json|grep office2018
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:97b54655545314ef8dd04ba3b222bbd3f0ad45822c4702036a1c888a6dfe9fce"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:f2b68cca01684f35787cdd6e380087378fd6554dbc09f23a0280bd0b698805db"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:e746b6b263795400c8f9b00f300555a09c0d4def527b02679b15a9bac5659fd7"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:4a3ab6b82515733c32046bed365f8d9a3782385138dd54ff54e5f3ad4af90b46"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:277897ed65ca5cadb4ee52a1bbfbf18c7ac59290b2ff2d88cbebb303de3db23b"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:5ef3b3bf46f663bea90ea569c5f35fa4084c54487e9e1069be3452fcb3e62fbe"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:3ae65105bf2e092fa8de48f14c801b5a795ebf47d9dda890d811fd1256584398"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:b2fec434d4b4ea27cc38446645582e92c6198ca66886ad38b191c7e7e830df1d"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:fcfa22e43e89dad17c1ba682db120fc51f0427a51a5b43d94cd32478d449501f"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:0466668e7767682498666968362d79d4455b5154aa2c2342058161fcd6bf4b6b"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:3724d55b15fcc3862630fa1c353381a8626ca99ca50ba3567713a114918df9df"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:0b2b553f12ecf85604e67313ca00b39882cc1da4d49f02bbb1c0bea9da3db211"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:3a2ca4aedffe1bfbb73c5d2b0fec5f8e0d0bf248c92ab36e3169669b69dde640"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:13d38223ec48df7f89b915e28fcc3915e38a171f3738e308a3e4c1f0d25f3155"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:9a65fa7bc2290d77a9d456cf59e96c452fc0f56b4d01c91f750aa732339c5c53"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:82046a3a6c95358eded3d2558d012e295c5551168b864e8326ed9ec06314dc21"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:2a8786f20a3e3dc60c4238a8398c4c85a0b529d45ead95cc7fc3b54583393819"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:6465cab58d35bd4bc0ba6f24f7160076a2b875e4057dc7edd5b8ebe8df557e84"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:a74ea99fab7a058c51d38ef96fd38872b43b6fd0d4d8179327abbc7cd2c07ed3"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:0b36abea9831da563bb2103d528bcd614742334d7c3ae6bd0791c9aa7f84388c"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:e2b710cd983000457fff47d1f6ffac7c1c660e425a37d4ea3ae010aa1538d61a"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:bf1ccdbd702f2b17e0a750b5dc2c40f19e27a3e7b23bc49840bfd9a72f951baa",
                            "registry.thux.dev/customers/adk/office2018.adk.com:topic-default-fake-production"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:78390fd8469da95655aff214662b30461e08e3858770a038babe9291a3fd0bef"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:f2801a3fa957e286d09eecaa46f844ddea8b1cbc0fbef53dd121431bc75ad2af"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:07fcc0f2a6a84e9bbd790e25ec48b5f0e08f62f1184306d53d288c42981b6afb"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:87a3a9a4321260e0e9205f6948c24781a34b9e34f1e42d14bdafc39dc5da6a7e"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:632132321496881841809d4b5557a8193ef1d9f3f6f7d44a47587ebd5d958221"
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:7b2ec2b9fdb254b2d33123f41de1f9d4e284c8ecc5387fba46742e01e72dac0d"

Many different versions of the image are listed for another pod. These are just images build by me and deployed in what I consider the same way…

can you post the full output of:

kubectl get node -o json 
{
    "apiVersion": "v1",
    "items": [
        {
            "apiVersion": "v1",
            "kind": "Node",
            "metadata": {
                "annotations": {
                    "node.alpha.kubernetes.io/ttl": "0",
                    "projectcalico.org/IPv4Address": "10.2.201.112/24",
                    "projectcalico.org/IPv4VXLANTunnelAddr": "10.21.231.128",
                    "volumes.kubernetes.io/controller-managed-attach-detach": "true"
                },
                "creationTimestamp": "2022-01-17T09:48:14Z",
                "labels": {
                    "beta.kubernetes.io/arch": "amd64",
                    "beta.kubernetes.io/os": "linux",
                    "kubernetes.io/arch": "amd64",
                    "kubernetes.io/hostname": "adk-b1-staging",
                    "kubernetes.io/os": "linux",
                    "microk8s.io/cluster": "true",
                    "node.kubernetes.io/microk8s-controlplane": "microk8s-controlplane"
                },
                "name": "adk-b1-staging",
                "resourceVersion": "2881383",
                "selfLink": "/api/v1/nodes/adk-b1-staging",
                "uid": "4ff78599-96aa-42a2-9c2c-611ba9a81437"
            },
            "spec": {},
            "status": {
                "addresses": [
                    {
                        "address": "10.2.201.112",
                        "type": "InternalIP"
                    },
                    {
                        "address": "adk-b1-staging",
                        "type": "Hostname"
                    }
                ],
                "allocatable": {
                    "cpu": "4",
                    "ephemeral-storage": "80415192Ki",
                    "hugepages-2Mi": "0",
                    "memory": "8045856Ki",
                    "pods": "110"
                },
                "capacity": {
                    "cpu": "4",
                    "ephemeral-storage": "81463768Ki",
                    "hugepages-2Mi": "0",
                    "memory": "8148256Ki",
                    "pods": "110"
                },
                "conditions": [
                    {
                        "lastHeartbeatTime": "2022-01-27T12:06:52Z",
                        "lastTransitionTime": "2022-01-27T12:06:52Z",
                        "message": "Calico is running on this node",
                        "reason": "CalicoIsUp",
                        "status": "False",
                        "type": "NetworkUnavailable"
                    },
                    {
                        "lastHeartbeatTime": "2022-01-29T17:22:57Z",
                        "lastTransitionTime": "2022-01-17T09:48:14Z",
                        "message": "kubelet has sufficient memory available",
                        "reason": "KubeletHasSufficientMemory",
                        "status": "False",
                        "type": "MemoryPressure"
                    },
                    {
                        "lastHeartbeatTime": "2022-01-29T17:22:57Z",
                        "lastTransitionTime": "2022-01-17T09:48:14Z",
                        "message": "kubelet has no disk pressure",
                        "reason": "KubeletHasNoDiskPressure",
                        "status": "False",
                        "type": "DiskPressure"
                    },
                    {
                        "lastHeartbeatTime": "2022-01-29T17:22:57Z",
                        "lastTransitionTime": "2022-01-17T09:48:14Z",
                        "message": "kubelet has sufficient PID available",
                        "reason": "KubeletHasSufficientPID",
                        "status": "False",
                        "type": "PIDPressure"
                    },
                    {
                        "lastHeartbeatTime": "2022-01-29T17:22:57Z",
                        "lastTransitionTime": "2022-01-27T12:05:57Z",
                        "message": "kubelet is posting ready status. AppArmor enabled",
                        "reason": "KubeletReady",
                        "status": "True",
                        "type": "Ready"
                    }
                ],
                "daemonEndpoints": {
                    "kubeletEndpoint": {
                        "Port": 10250
                    }
                },
                "images": [
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:97b54655545314ef8dd04ba3b222bbd3f0ad45822c4702036a1c888a6dfe9fce"
                        ],
                        "sizeBytes": 274659667
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:f2b68cca01684f35787cdd6e380087378fd6554dbc09f23a0280bd0b698805db"
                        ],
                        "sizeBytes": 274657654
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:e746b6b263795400c8f9b00f300555a09c0d4def527b02679b15a9bac5659fd7"
                        ],
                        "sizeBytes": 271048684
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:4a3ab6b82515733c32046bed365f8d9a3782385138dd54ff54e5f3ad4af90b46"
                        ],
                        "sizeBytes": 271036808
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:277897ed65ca5cadb4ee52a1bbfbf18c7ac59290b2ff2d88cbebb303de3db23b"
                        ],
                        "sizeBytes": 271030951
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:5ef3b3bf46f663bea90ea569c5f35fa4084c54487e9e1069be3452fcb3e62fbe"
                        ],
                        "sizeBytes": 271029353
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:3ae65105bf2e092fa8de48f14c801b5a795ebf47d9dda890d811fd1256584398"
                        ],
                        "sizeBytes": 271028136
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:b2fec434d4b4ea27cc38446645582e92c6198ca66886ad38b191c7e7e830df1d"
                        ],
                        "sizeBytes": 270939162
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:fcfa22e43e89dad17c1ba682db120fc51f0427a51a5b43d94cd32478d449501f"
                        ],
                        "sizeBytes": 270859211
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:0466668e7767682498666968362d79d4455b5154aa2c2342058161fcd6bf4b6b"
                        ],
                        "sizeBytes": 270837554
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:3724d55b15fcc3862630fa1c353381a8626ca99ca50ba3567713a114918df9df"
                        ],
                        "sizeBytes": 270836445
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:0b2b553f12ecf85604e67313ca00b39882cc1da4d49f02bbb1c0bea9da3db211"
                        ],
                        "sizeBytes": 270835551
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:3a2ca4aedffe1bfbb73c5d2b0fec5f8e0d0bf248c92ab36e3169669b69dde640"
                        ],
                        "sizeBytes": 270832282
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:13d38223ec48df7f89b915e28fcc3915e38a171f3738e308a3e4c1f0d25f3155"
                        ],
                        "sizeBytes": 270831577
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:9a65fa7bc2290d77a9d456cf59e96c452fc0f56b4d01c91f750aa732339c5c53"
                        ],
                        "sizeBytes": 270822049
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:82046a3a6c95358eded3d2558d012e295c5551168b864e8326ed9ec06314dc21"
                        ],
                        "sizeBytes": 270817643
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:2a8786f20a3e3dc60c4238a8398c4c85a0b529d45ead95cc7fc3b54583393819"
                        ],
                        "sizeBytes": 270792483
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:6465cab58d35bd4bc0ba6f24f7160076a2b875e4057dc7edd5b8ebe8df557e84"
                        ],
                        "sizeBytes": 270738917
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:a74ea99fab7a058c51d38ef96fd38872b43b6fd0d4d8179327abbc7cd2c07ed3"
                        ],
                        "sizeBytes": 270701303
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:0b36abea9831da563bb2103d528bcd614742334d7c3ae6bd0791c9aa7f84388c"
                        ],
                        "sizeBytes": 270633702
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:e2b710cd983000457fff47d1f6ffac7c1c660e425a37d4ea3ae010aa1538d61a"
                        ],
                        "sizeBytes": 258012282
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:bf1ccdbd702f2b17e0a750b5dc2c40f19e27a3e7b23bc49840bfd9a72f951baa",
                            "registry.thux.dev/customers/adk/office2018.adk.com:topic-default-fake-production"
                        ],
                        "sizeBytes": 258007996
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:78390fd8469da95655aff214662b30461e08e3858770a038babe9291a3fd0bef"
                        ],
                        "sizeBytes": 258004630
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:f2801a3fa957e286d09eecaa46f844ddea8b1cbc0fbef53dd121431bc75ad2af"
                        ],
                        "sizeBytes": 257995041
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:07fcc0f2a6a84e9bbd790e25ec48b5f0e08f62f1184306d53d288c42981b6afb"
                        ],
                        "sizeBytes": 254356951
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:87a3a9a4321260e0e9205f6948c24781a34b9e34f1e42d14bdafc39dc5da6a7e"
                        ],
                        "sizeBytes": 254356200
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:632132321496881841809d4b5557a8193ef1d9f3f6f7d44a47587ebd5d958221"
                        ],
                        "sizeBytes": 254159501
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/office2018.adk.com@sha256:7b2ec2b9fdb254b2d33123f41de1f9d4e284c8ecc5387fba46742e01e72dac0d"
                        ],
                        "sizeBytes": 254148597
                    },
                    {
                        "names": [
                            "docker.io/bretfisher/shpod@sha256:08aaefebc11e2371930a53673cca7b7bf97aa62a39ca3b706bf349a21f74be7b",
                            "docker.io/bretfisher/shpod:latest"
                        ],
                        "sizeBytes": 251887812
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/www2020.adk.it@sha256:8047ea2b1f5b88ebb5c9fcc0c6073dbcfbb0a33e0252236e67062e1ca58cd8ec",
                            "registry.thux.dev/customers/adk/www2020.adk.it:branch-default"
                        ],
                        "sizeBytes": 192760111
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/www2020.adk.it@sha256:71eb2245ceab06e75b46da90cb3cdf22d9ed2de8f407a041015b1ba2b2b735bc"
                        ],
                        "sizeBytes": 192147336
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/www2020.adk.it@sha256:995e89ebe0a58037a4d31a5e1e486e7f41f3a4f095ee9b45ed353da2cc218086",
                            "registry.thux.dev/customers/adk/www2020.adk.it:topic-default-ticket-23823"
                        ],
                        "sizeBytes": 184777884
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/www2020.adk.it@sha256:7fcd02efee083d31b9089bb4d857979b9e1681a26a2a1863bc864540a97b729c"
                        ],
                        "sizeBytes": 184775168
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/www2020.adk.it@sha256:a4866142676f35589f2e6b6758d6f37615912981599cfbd98bea467fb1fc7718"
                        ],
                        "sizeBytes": 184773734
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/www2020.adk.it@sha256:094a6a78faeaa98c2539e4e42aa3364dd2e992ad00c97f34aed3528b54dc91fb"
                        ],
                        "sizeBytes": 184771429
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/dealer2021.adk.it@sha256:648344d989a66b25bfaf6f4e43372057ead71412a55def056175409cebb53ea3",
                            "registry.thux.dev/customers/adk/dealer2021.adk.it:branch-default"
                        ],
                        "sizeBytes": 180590950
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/dealer2021.adk.it@sha256:b277c019dd3217a18b9fd7d48512cb61773a83f4df49b89f9987682bc0bdd643"
                        ],
                        "sizeBytes": 180103065
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/www2020.adk.it@sha256:f886b5e34d0b2eb3ce826fe625f6960ec93ccadbf366c20dc4de8e309aec4a2c"
                        ],
                        "sizeBytes": 176093978
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/gfp2020.adk.it@sha256:f89222fafc1bcd85bbfcd29483dec8cb7eeb052772da5225c0fd8d3a61c92c01",
                            "registry.thux.dev/customers/adk/gfp2020.adk.it:branch-default"
                        ],
                        "sizeBytes": 173432159
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/gfp2020.adk.it@sha256:dc1c9df6377f34b0e7c2a2f98a2f28de66ced9f67e87d6d6bf9750805840905a"
                        ],
                        "sizeBytes": 172903703
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/www2020.adk.it@sha256:e4e234ccb2aea844c713b526579d9b2fae8774c5f543e6df25684e68b512d1fe",
                            "registry.thux.dev/customers/adk/www2020.adk.it:topic-default-fix-fcm"
                        ],
                        "sizeBytes": 168725615
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/gfp2020.adk.it@sha256:a731d3e46172e053948528737c9a863ab8bfc6cc3dad16bb035930259ca7763f"
                        ],
                        "sizeBytes": 157394966
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/provider2020.adk.it@sha256:9b84d7d456a13ea9459bbb48eba7408825d330c04552f9c2f9e6caeef6e3ea03",
                            "registry.thux.dev/customers/adk/provider2020.adk.it:topic-default-tournament-fields"
                        ],
                        "sizeBytes": 140931776
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/provider2020.adk.it@sha256:61cd6460237408566ffe997ef57d2d55284dddeb79ede02f6157e9fa008c5e15"
                        ],
                        "sizeBytes": 140930181
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/provider2020.adk.it@sha256:2e66de241dfb299cecddc7325d8d1276b097b30729d66c4045a99b94c4a84539"
                        ],
                        "sizeBytes": 140928568
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/provider2020.adk.it@sha256:2fec6ce2a3de1639d56c13015ebdca59a76bee47ead58040e9ad3938be411969"
                        ],
                        "sizeBytes": 140927203
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/provider2020.adk.it@sha256:6b8d757140841960ed2eb51432af5ae9bf95583b7875ac80d8a8a3219cde6c3f",
                            "registry.thux.dev/customers/adk/provider2020.adk.it:branch-default"
                        ],
                        "sizeBytes": 140922940
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/provider2020.adk.it@sha256:7ef436b2bab8f9b45fd2307b0bf47860cc78324908a8f6568cad66e7173807d2"
                        ],
                        "sizeBytes": 140211869
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/provider2020.adk.it@sha256:02c054d208c11bfaeb55ba87045328861cbddc31ebcb26728a479f1185e962b8"
                        ],
                        "sizeBytes": 140207743
                    },
                    {
                        "names": [
                            "registry.thux.dev/customers/adk/provider2020.adk.it@sha256:a32f99dceba76f25332c5cc464a28c8cab00fa9657edcb251a076b203ce25f16"
                        ],
                        "sizeBytes": 124718236
                    }
                ],
                "nodeInfo": {
                    "architecture": "amd64",
                    "bootID": "ad49df19-17ea-42f8-afb9-44f50f44d9ad",
                    "containerRuntimeVersion": "containerd://1.5.7",
                    "kernelVersion": "5.4.0-94-generic",
                    "kubeProxyVersion": "v1.23.3-2+d441060727c463",
                    "kubeletVersion": "v1.23.3-2+d441060727c463",
                    "machineID": "766e1146e79e48faa25a3a02ebaa13ed",
                    "operatingSystem": "linux",
                    "osImage": "Ubuntu 20.04.3 LTS",
                    "systemUUID": "766e1146e79e48faa25a3a02ebaa13ed"
                }
            }
        }
    ],
    "kind": "List",
    "metadata": {
        "resourceVersion": "",
        "selfLink": ""
    }
}

What version of kubernetes are you using?

Sorry, I somehow missed your question. I’m using latest stable microk8s with 1.23.3

sandro

Hello,
below is th command to list all downloaded images on your kubernetes cluster, even the one that are not currently in use:

kubectl get nodes -o json | jq -r ‘.items.status.images.names’ | grep -v ‘@sha256’ | sort -u

If you want to see images on a specific node:

kubectl get node -o json | jq -r ‘.status.images.names’ | grep -v ‘@sha256’ | sort -u

It work with kubernetes 1.30

Regards

Hey, I have tried the commands from your post, but it didn’t work out for me. There are some images it is not listing. My kubernetes version is 1.29.4.