How to upgrade the helm chart deployment using a file

1/8/2019

Below is Helm code to install

helm install coreos/kube-prometheus --name kube-prometheum --namespace monitoring -f kube-prometheus.yml

by this way we can override the value.yml values with the values present in kube-prometheus.yml.

Is there any way by which we can first install and then update the value.yml from kube-prometheus.yml file.

I can use helm upgrade releasename kube-prometheumafter changing the value.yml file directly. I don't want that

Use case: Initially, I used an image with tag 1.0 in value.yml. Now I have below code in kube-prometheus.yml just to update the image tag

prometheusconfigReloader:
image:
 tag: 2.0

Instead of deleting and creating again. I want to upgrade it. This is just for example, there could be multiple values. that is why I can't use -set.

-- Vikas Rathore
kubernetes
kubernetes-helm

1 Answer

1/8/2019

So you first run helm install coreos/kube-prometheus --name kube-prometheum --namespace monitoring -f kube-prometheus.yml with your values file set to point at 1.0 of the image:

prometheusconfigReloader:
image:
 tag: 1.0

Then you change the values file or create a new values file or even create a new values file containing:

prometheusconfigReloader:
image:
 tag: 2.0

Let's say this file is called kube-prometheus-v2.yml Then you can run:

helm upgrade -f kube-prometheus-v2.yml kube-prometheum coreos/kube-prometheus

Or even:

helm upgrade -f kube-prometheus.yml -f kube-prometheus-v2.yml kube-prometheum coreos/kube-prometheus

This is because both values file overrides will be overlaid and according to the helm upgrade documentation "priority will be given to the last (right-most) value specified".

Or if you've already installed and want to find out what the values file that was used contained then you can use helm get values kube-prometheum

-- Ryan Dawson
Source: StackOverflow