Kubernetes cronjob and image pulling

7/23/2020

Let's say I have a cronjob created at my cluster. It runs once a day.

My question is, on the second, third, etc. run will it use the cached copy of the pulled image (does Kubernetes have something like a "pulled image local cache"?) or for each and every cronjob run my kubernetes cluster will pull the image from my private repository?

-- jliendo
kubernetes

1 Answer

7/23/2020

That depend's on how your image is tagged and additional configuration. If it's image with specific version then it will pull only once until you specify other. If image is tagged with :latest tag or imagePullPolicy: Always is specified for that pod, then Kubernetes will try to keep image for that particular pod up to date as possible (might pull image over restart's) More common problem is how to force Kubernete's to pull new version of image each time the pod is run. Please read here:

https://stackoverflow.com/a/35941366/12053054

-- Norbert Dopjera
Source: StackOverflow