62

I am trying to install a previous version of Prometheus, namely version 6.7.4:

helm install -f stable/prometheus/values.yaml prometheus --name stable/prometheus --namespace prometheus --version 6.7.4

However it installs the latest version, prometheus-6.8.0:

$ helm ls
NAME        REVISION    UPDATED                     STATUS      CHART               NAMESPACE 
prometheus  1           Fri Jul  6 01:46:42 2018    DEPLOYED    prometheus-6.8.0    prometheus

What am I doing wrong?

1
  • 3
    --version 6.7.4 should do the trick. is it possible run the command from a working directory that had a copy of the latest chart? (the way you point to values files suggest you have the chart locally)
    – itaysk
    Jul 6, 2018 at 19:38

7 Answers 7

40

Below worked for me with Helm-3:

Step-1 : helm search repo mongo -l

( Assuming you have already done helm repo add bitnami https://charts.bitnami.com/bitnami)

Step-2 : Check the mongo version you want to install and note the corresponding latest chart version

Step-3 : Use the chart version from above to install the specific version of mongoDB using --version.

helm install my-mongodb bitnami/mongodb --version 8.3.1

Note : 8.3.1 is the chart version not mongoDB version

1
  • Did not work for me, I had to add quotes like --version "8.3.1" for it to pull the correct version of the chart.
    – Ahi Tuna
    Jan 31 at 22:48
21

I see in the helm install code:

# help provides possible cli installation arguments
help () {
  echo "Accepted cli arguments are:"
  echo -e "\t[--help|-h ] ->> prints this help"
  echo -e "\t[--version|-v <desired_version>] . When not defined it defaults to latest"
  echo -e "\te.g. --version v2.4.0  or -v latest"
}

So just in case, do try with: --version v6.7.4 instead of --version 6.7.4.

4
  • 1
    Good idea but still doesn't work. Ran helm del --purge prometheus. helm ls correctly returns an empty list. Then helm install --version v6.7.4 --namespace prometheus --name prometheus stable/prometheus. helm ls returns again prometheus-6.8.0. I can confirms from k8s dashboard that 6.8.0 was installed. Jul 6, 2018 at 10:54
  • @MasterScrat: were you able to resolve this issue.. I am also running into same issue so asking.. I tried helm delete --purge command and then helm install, but no help
    – lucky
    Nov 26, 2018 at 8:59
  • @lucky no I never figured it out Nov 26, 2018 at 9:16
  • 7
    this is out of the script that installs helm itself. the question is about installing a specific version of a helm chart.
    – EisenRatte
    Mar 13, 2019 at 12:28
19

I think your command is wrong:

helm install -f stable/prometheus/values.yaml prometheus --name stable/prometheus --namespace prometheus --version 6.7.4

Helm install command is:

helm install [CHART] [flags]

So in your case this should be:

helm install prometheus stable/prometheus -f stable/prometheus/values.yaml  --namespace prometheus

-- version is used for chart versions:

  --version string           Specify the exact chart version to use. If this is not specified, the latest version is used

Above command will install Prometheus version that is specified in values.yaml under tag but read this: https://github.com/helm/charts/tree/master/stable/prometheus for full list of parameters.

12

Use --version "0.15.0" i.e. the version number in double quotes. It worked for me.

1
  • Same, for me it worked with quotes and without the quotes it did not work.
    – Ahi Tuna
    Jan 31 at 22:50
10

I didn't see an accepted answer and of course arrived here via Google and Reddit, so posting here.

Confirmed working:

➜ helm install argocd argo/argo-cd --version="1.6.2" -f argocd-helm-values.yaml -n argocd
...
➜ helm list --all-namespaces
NAME    NAMESPACE   REVISION    UPDATED                                 STATUS      CHART           APP VERSION
argocd  argocd      1           2020-08-22 16:35:37.516098 +0700 +07    deployed    argo-cd-1.6.2   1.3.6

It seems the placement of --version matters. Placing it after the -n (namespace) caused an error. However placing it before/after the -f worked fine.

Quotes didn't matter, both the commands below worked fine:

➜ helm install argocd argo/argo-cd -f argocd-helm-values.yaml --version=1.6.2 -n argocd
➜ helm install argocd argo/argo-cd --version="1.6.2" -f argocd-helm-values.yaml -n argocd

Finally, it seems that the equal sign is optional. Both the commands below also worked:

➜ helm install argocd argo/argo-cd -f argocd-helm-values.yaml --version=1.6.2 -n argocd
➜ helm install argocd argo/argo-cd -f argocd-helm-values.yaml --version 1.6.2 -n argocd

TL;DR

helm install <RELEASE_NAME> <REPO>/<CHART> --version <VERSION>

eg.
helm install my_release repo/app --version 1.0.0
0

I don't have the RCA however faced the same issue and it looks like it happens only when we use --version flag to specify the version. I used the path to chart directory which was created by downloading the chart pkg and exploding and it worked like charm.

0

First Upgrade your tiller

helm init --service-account tiller --wait --upgrade

Then in --version flag use chart version relevant to prometheus version which you are trying to install.

Eg: helm install stable/prometheus --namespace monitoring --name prometheus --version=8.5.0

Here I tried to install 2.6.1 prometheus version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.