Kubernetes get container image url

8/13/2019

Is there a way to identify the url from where container executing in Kubernetes POD was pulled from ?

The Kubernetes Image doc indicate only image name is provided as part of Pod specification.

I would like to identify if image was pulled from Google Container Registry, Amazon ECR, IBM Cloud Container Registry etc.

-- learningMyWayThru
kubectl
kubernetes

1 Answer

8/13/2019

You can use the image id to understand that. Something like

kubectl get pod pod-name-123 -o json | jq '.status.containerStatuses[] | .imageID'

will return something like:

"docker-pullable://redacted.dkr.ecr.eu-west-2.amazonaws.com/docker-image-name@sha256:redacted"

In my example was pulled from aws ecr.

-- Federkun
Source: StackOverflow