2
votes

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.

1
Can you give an example of the sequence you're thinking of, and why you'd want it? I'd recommend just using helm install -f once (to not deploy resources with default values and then change them to what you actually want) but this seems to be what you don't want to do. - David Maze
@DavidMaze: updated my question. thanks for helping - Vikas Rathore

1 Answers

4
votes

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