imagePullPolicy differs from the standard K8s behavior when using :latest tag

Bug #2056203 reported by Allan Vidal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Wishlist
Unassigned

Bug Description

Hi

When using K8s directly, if you don't specify an `imagePullPolicy` and use an image with `:latest` in its tag, `imagePullPolicy: Always` will be assumed. See: https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting

When using Juju passing an OCI image URL as a resource to it (e.g., `localhost:32000/myapp:latest`), it seems that we always end up with `imagePullPolicy: IfNotPresent`. At least as of Juju 2.9.45.

That can make local development harder, because just pushing new versions of the image while keeping the same `:latest` tag will not cause K8s to pick up new changes.

Is this by design, or is this something that could be changed to align Juju with default K8s behavior?

At the moment, as a workaround when using microk8s, I'm running the following to get it to pull again images with `:latest`:
```
microk8s.ctr images list -q | grep localhost:32000/myapp | xargs microk8s.ctr images rm
```

I've previously reported this in a Matrix channel, but I'm also sending this here so it's more easily findable by others in the future, even if this is deemed to not be a bug.

Thank you,
Allan

Revision history for this message
Joseph Phillips (manadart) wrote :

Triaged as wishlist, because there is a work-around.

As you have observed, Juju only ever uses the one policy default throughout.

I think it's a safe default, because it ensures homogeneity across units of the same application.

Changed in juju:
status: New → Triaged
importance: Undecided → Low
importance: Low → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.