jupyterhub / kubespawner

Kubernetes spawner for JupyterHub
https://jupyterhub-kubespawner.readthedocs.io
BSD 3-Clause "New" or "Revised" License
543 stars 304 forks source link

Omit ImagePullPolicy by default #807

Closed yuvipanda closed 10 months ago

yuvipanda commented 10 months ago

Our documentation says that if ':latest' is used as a tag in an image, ImagePullPolicy will be automatically set by Kubernetes to 'Always'. This cites https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting.

However, that's only true if the imagePullPolicy is omitted! But we actually do set it, to 'IfNotPresent', so this behavior is actually not what we get. This came to light when a user noticed that on nodes with images already present, ':latest' was not taking effect. Looking at the pod definition, we see:

image: quay.io/henrykmodzelewski/2i2c-eosc211:latest
imagePullPolicy: IfNotPresent

This PR just omits imagePullPolicy by default, so we actually get the behavior we said we were getting.

yuvipanda commented 10 months ago

Because allow_none is not currently true, it's actually not possible to get the default kubernetes behavior right now!

yuvipanda commented 10 months ago

Thanks, @GeorgianaElena!

yuvipanda commented 10 months ago

Merging as there was enough approvals!