Only pull images if they are not available locally#16
Only pull images if they are not available locally#16zonque wants to merge 1 commit intocuber-cloud:masterfrom
Conversation
Avoid excessive downloads and only pull images if needed. This makes the rollout faster and also helps to reduce traffic when cronjobs are used.
|
Thanks for your suggestion. Maybe you have misunderstood the meaning of "Always". This is the definition:
Based on that, I don't think that you are going to save bandwidth if you use "IfNotPresent" instead of "Always". It's just a quick digest check with the registry, not a download of the image. |
|
I have seen the image being pulled from DockerHub each time a cronjob is performed 🤔 FWIW, this is a deployment based on k3s. |
|
@zonque Have you tried to open an issue in the k3s repository to report that strange behavior (incompatible with k8s documentation)? |
|
Hmm. The reason is probably that k3s does not come with a full registry by default. But tbh, I find the k8s documentation a bit ambiguous, and would rather argue that there is no need to pull an image if it does exist locally, and hence 'IfNotPresent' appears the right choice 🤷 Could this setting be made configurable by the user of Cuber maybe? |
K8s documentation is pretty clear: only the image hash is checked, there isn't any download if the image is already present locally. You can also find a confirmation of that by searching online.
It depends. There are pros and cons. |
I'm curious what the cons would be. |
|
@zonque You can find many discussions by searching "imagepullpolicy ifnotpresent vs always". For example:
|
|
Understood. But can we make it configurable maybe so more use cases are covered? |
Avoid excessive downloads and only pull images if needed. This makes the rollout faster and also helps to reduce traffic when cronjobs are used.