Will Changing the Image Repository Force a Redeployment in Kubernetes?

0
12
Asked By CuriousCoder42 On

I'm working with StatefulSets for Redis and RabbitMQ using the Bitnami helm charts and I have set the "imagePullPolicy" to "IfNotPresent". I'm planning to change the repository URL from Bitnami to Bitnami Archive; both have the exact same image content with matching MD5/hashes. I'm wondering if Kubernetes will recognize that there's no change and keep the current image cache and StatefulSet running, or if this change will trigger a new image pull and force a rollout of new application pods.

4 Answers

Answered By CodeExplorer74 On

From what I explored, changing the image URLs in CI from a local registry to GitLab's one doesn't always trigger a download of the images again if they have the same digest. However, be aware that it might still kick off a Kubernetes rollout even if no new downloads happen.

DevOpsDude17 -

So it seems like there won't be a redownload, but is it confirmed that Kubernetes will trigger a rollout? That's a bit concerning.

Answered By StatefulSetSavant On

Changing the spec.template will definitely cause a rollout since it changes the SHA of the replicaset. The only workaround I've found for StatefulSets is to set an onDelete strategy to avoid that behavior.

Answered By SkepticalAdmin23 On

Honestly, I doubt Kubernetes has that kind of intelligence. From my experience, I think a rollout will occur, but the container runtime should reuse the cached image if available.

Answered By K8sWhizKid On

Any change to the image tag, name, or repository location typically changes the pod template hash, which I would expect to trigger a redeployment or update.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.