Search code examples
kubernetes-helmhelm3

When to use --version option in helm upgrade


I'm trying to understand when and how --version option in helm upgrade works. In the docs it says:

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

Lets say I have installed my app.

helm install my-app-rls my-app-1.0.0.tgz

Now, If I update my chart and create another package my-app-1.0.1.tgz I can upgrade by

helm upgrade my-app-rls my-app-1.0.1.tgz

Chart.yaml of my-app-1.0.1.tgz already contains a version. When does --version need to be used? What is the use case of it?


Solution

  • You use --version when pulling a chart from a chart repository. For example:

    helm upgrade app chart_name \
      --version 1.0.0 \
      --repo https://chart.repo.example.com \
      --install --values ./values.yml
    

    This says to find and use version 1.0.0 found at the url defined by --repo