In the Kubernetes documentation it mentions that the caching semantic of using ImagePullPolicy: Always
makes the ImagePullPolicy quite efficient. What reasons would I want to choose a different ImagePullPolicy?
It heavily depends on your versioning/tagging strategy.
When new replicas of your application are created (because your app has scaled up, or a pod has died and it's been replaced by a new pod), if you use ImagePullPolicy: Always
and you have pushed a different version of your application using the same tag (like people do when using latest
), the new created replicas might run a totally different version of the application than the rest of the replicas, leading to an inconsistent behavior.
You also may want to use a different value than Always
when on a development environment like minikube.
There isn't much of a disadvantage to ImagePullPolicy: Always
, but having the control means that:
ImagePullPolicy: Always
Note that in fiunchinho's answer it mentions that you can use it to keep various replicas of an application in sync. This would be dangerous as images as pulled per node, and so you could end up with different versions of the application running on different nodes.