philpep / imago

Ensure kubernetes pods run on latest images builds from the docker registry
Apache License 2.0
95 stars 13 forks source link

Issue with docker hub ( library only it seems) #33

Closed Celedhrim closed 2 years ago

Celedhrim commented 2 years ago

Hello ,

Maybe it's docker hub , but here is my deployment:

...
        image: docker.io/library/nextcloud:latest
        imagePullPolicy: Always
...

Imago say :

2022/03/21 09:32:01     app on app-7dfcd6b8c-97gct need to be updated from docker.io/library/nextcloud@sha256:069177198529ce4fcc4705c4d3953082142be7001edf0ee2ba76461fcb1d11df to
docker.io/library/nextcloud@sha256:6bf15beecaeaca23442375182e9cde1c34830cf661fc017b7aba978cdeaa5ca2

kubectl event on deployement restart said :

2s          Normal   Pulling             pod/app-69d94675b7-6gtxc      Pulling image "docker.io/library/nextcloud:latest"
0s          Normal   Pulled              pod/app-69d94675b7-6gtxc      Successfully pulled image "docker.io/library/nextcloud:latest" in 1.484645146s

And describing the pods said :

    Image ID:       docker.io/library/nextcloud@sha256:069177198529ce4fcc4705c4d3953082142be7001edf0ee2ba76461fcb1d11df

So the issue is taht imago see an update hash , but k3s / crictl said that we are already at the last hash of this tag

Have you any idea ?

Celedhrim commented 2 years ago

OK ! seems to be a docker hub issue

A sha is available but image download give another :

time="2022-03-21T22:10:23.149321213+01:00" level=info msg="PullImage \"nextcloud\""
time="2022-03-21T22:10:28.610574475+01:00" level=info msg="ImageUpdate event &ImageUpdate{Name:docker.io/library/nextcloud:latest,Labels:map[string]string{io.cri-containerd.image: managed,},XXX_unrecognized:[],}"
time="2022-03-21T22:10:29.757823153+01:00" level=info msg="ImageUpdate event &ImageUpdate{Name:sha256:54e161b9e9ea0d7dc842ed150cc9ce7950bf7ff73be741e2d50b0dbc28a0f110,Labels:map[string]string{io.cri-containerd.image: managed,},XXX_unrecognized:[],}"
time="2022-03-21T22:10:30.195642385+01:00" level=info msg="ImageUpdate event &ImageUpdate{Name:docker.io/library/nextcloud:latest,Labels:map[string]string{io.cri-containerd.image: managed,},XXX_unrecognized:[],}"
time="2022-03-21T22:10:30.662434862+01:00" level=info msg="ImageUpdate event &ImageUpdate{Name:docker.io/library/nextcloud@sha256:6bf15beecaeaca23442375182e9cde1c34830cf661fc017b7aba978cdeaa5ca2,Labels:map[string]string{io.cri-containerd.image: managed,},XXX_unrecognized:[],}"
time="2022-03-21T22:10:30.666956780+01:00" level=info msg="PullImage \"nextcloud\" returns image reference \"sha256:54e161b9e9ea0d7dc842ed150cc9ce7950bf7ff73be741e2d50b0dbc28a0f110\""
philpep commented 2 years ago

Hi, thanks for debugging this. Do you use other architecture than x86_64 ?

Since sha256 checksums are architecture dependent, I think running imago on a machine with an architecture which is different than k8s nodes is not supported yet.

Celedhrim commented 2 years ago

imago and k3s run on the same machine ,

Problem is ONLY with docker image from docker.io/library/ , so it's purely from docker hub I think.

ps: Thx for your great tool ! :)