Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit ImagePullPolicy by default #807

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

yuvipanda
Copy link
Collaborator

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.

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:

```yaml
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
Copy link
Collaborator Author

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

kubespawner/objects.py Outdated Show resolved Hide resolved
kubespawner/spawner.py Outdated Show resolved Hide resolved
Co-authored-by: Georgiana <[email protected]>
@yuvipanda
Copy link
Collaborator Author

Thanks, @GeorgianaElena!

@yuvipanda yuvipanda merged commit 4984783 into jupyterhub:main Nov 13, 2023
7 checks passed
@yuvipanda
Copy link
Collaborator Author

Merging as there was enough approvals!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants