What happened:
Trying to preload images in a cluster with the :latest tag doesn't work, kubelet never use the local image and always try to fetch it from the registry,.
What you expected to happen:
Being able to preload images with the :latest tag in my clusters
How to reproduce it (as minimally and precisely as possible):
Build an image locally with the latest tag
Load the image into the cluster with kind load docker-image
Create a pod with that image
If you don;t have the image into the registry the kubelet will fail to download it and is easier to debug.
Anything else we need to know?:
Seems that's containerd expected behaviour
containerd will not cache images with the latest tag so make sure you do not use ..
Environment:
kind version):kubectl version):docker info):/etc/os-release):ref: https://kind.sigs.k8s.io/docs/user/quick-start/#loading-an-image-into-your-cluster
Note: The Kubernetes default pull policy is IfNotPresent unless the image tag is :latest in which case the default policy is Always. IfNotPresent causes the Kubelet to skip pulling an image if it already exists.
I think that kind load docker-image should fail for images with latest tag
We provide the kind tool, which also has the load image function. For images containing :latest , this behavior is controlled by Kubernetes.
If we let load image return an error when it encounters :latest tag, I don't think it is reasonable. You can add a suggestion or a hint, maybe a better user experience.
I think you are absolutely right
Closing
[just noting my agreement on the outcome 馃槄]
warning about :latest behavior might be a good idea 馃憤 I can dig out some code I wrote to solve this sort of thing with another tool (note: :latest is a magical default, and parsing these correctly has some edge cases... 馃檭)
Most helpful comment
I think you are absolutely right
Closing