Kubernetes will pull upon Pod creation if either (see updating-images doc):
- Using images tagged
:latest
imagePullPolicy: Always
is specified
This is great if you want to always pull. But what if you want to do it on demand: For example, if you want to use some-public-image:latest
but only want to pull a newer version manually when you ask for it. You can currently:
- Set
imagePullPolicy
toIfNotPresent
orNever
and pre-pull: Pull manually images on each cluster node so the latest is cached, then do akubectl rolling-update
or similar to restart Pods (ugly easily broken hack!) - Temporarily change
imagePullPolicy
, do akubectl apply
, restart the pod (e.g.kubectl rolling-update
), revertimagePullPolicy
, redo akubectl apply
(ugly!) - Pull and push
some-public-image:latest
to your private repository and do akubectl rolling-update
(heavy!)
No good solution for on-demand pull. If that changes, please comment; I’ll update this answer.