Hot to list all local images on a Kubernetes node (AKS)

10/16/2019

Our deployment's imagePullPolicy wasn't set for a while, which means it used IfNotPresent.
If I understand correctly, each k8s node stored the images locally so they can be reused on the next deployment if necessary.

Is it possible to list/show all the stored local images per node in an AKS cluster

-- SagiLow
kubectl
kubernetes

2 Answers

10/16/2019

As docker is installed on every node of the k8s cluster, to list/show local images per node, you need login to the worker node and you could run :

    docker images

This would give you the list of all the images on that particular node.

-- Ratan Boddu
Source: StackOverflow

10/16/2019

Yes, you have to firstly check the node to which pod has been scheduled against that microservice.

kubectl -n namespace get pods -o wide

Once you get the node, try to setup an ssh connection with the node, this link can be used to do it.

Then you can execute following command in that VM

docker images

It will give you all docker images in that

-- Tushar Mahajan
Source: StackOverflow