Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Helm upgrade with same chart version, but different Docker image tag

I have a question about a Helm upgrade. I'm working on a chart foo-1.0.0 which deploys a pod with a docker image bar:4.5.1.

I have a release "myrelease" based on this chart foo in version 1.0.0 (with a bar:4.5.1 running inside).

Now, I make a fix on bar, rebuild the image bar:4.5.2, change the image in the chart but I did not bump its version. It is still foo-1.0.0

I launch:

$ helm upgrade myrelease repo/foo --version 1.0.0

My problem is that after the upgrade, my pod is still running the bar:4.5.1 instead the 4.5.2

Is the a "cache" in tiller? It seems that tiller did not download foo-1.0.0 again. Is there a way to force it to download?

like image 367
Fred Mériot Avatar asked Apr 13 '18 08:04

Fred Mériot


People also ask

What is the difference between Docker image and Helm chart?

Helm is a package manager, it uses Docker images as part of charts. Helm charts have configs for Kubernetes and it uses Docker images which are built from Dockerfile.

Does Helm upgrade pull new image?

Helm will roll out changes to kubernetes objects only if there are changes to roll out. If you use :latest there is no change to be applied to the deployment file, ergo no pods will rolling update.


1 Answers

You need to change the tag version in the image section of values.yaml:

image:
  repository: bar
  tag: 4.5.2
  pullPolicy: Always

and then run the following command:

helm upgrade myrelease repo/foo 

or just run the following:

helm upgrade myrelease repo/foo --set=image.tag=1.2.2

and set the applicable image version.

like image 85
Nick Rak Avatar answered Sep 21 '22 12:09

Nick Rak