Helm3 : Overriding image tag value

4/3/2020

I was trying to override the image tag in Helm3 using upgrade command by setting the variable at command line but it did not work. Has someone tried this feature in Helm3. Stuck for last couple of days, would be helpful to know your views.

Deployment manifest file looks like this:-

    containers:
   - image: {{ .Values.image.repository }}:{{.Values.image.tag}}
     imagePullPolicy: Always

Executing this command from command line:-

> helm upgrade resources-dev resources --set image.tag=72615 --dry-run --debug

does not override image tag value from 72626 to 72615

 containers:
  - image: aksresourcesapi.azurecr.io/microservicesinitiative:72626
    imagePullPolicy: Always

Deployment file enter image description here

Command Results:- helm upgrade resources-dev resources --set image.tag=72615 --reuse-values enter image description here Command Results of helm upgrade resources-dev resources --set-string image.tag=72615 enter image description here

-- Tarun Narang
kubernetes
kubernetes-helm

2 Answers

4/10/2020

Issue is identified, it's not with a --set flag but with the kind of directory structure I have for charts.

enter image description here

while executing the command

helm upgrade resources-dev resources --set image.tag=72615

one level up where resources (charts) folder is, it looks for image.tag in "Values.yaml" file of resources folder and not the "Values.yaml" file of backend folder and thus the tags are not replaced.

By executing the below command with backend.imge.tag worked helm upgrade resources-dev resources --install --set backend.image.tag=72615

-- Tarun Narang
Source: StackOverflow

4/3/2020

You should specify to helm that it is a string value. It is done with --set-string flag.

Also use --reuse-values in order to reuse the last release’s values and merge in any overrides from the command line via — set and -f

Executing the following command will solve the problem:

helm upgrade resources-dev resources --reuse-values --set-string image.tag=72615 --dry-run --debug
-- pcampana
Source: StackOverflow