114

When I try to install a chart with helm:

helm install stable/nginx-ingress --name my-nginx

I get the error:

Error: unknown flag: --name

But I see the above command format in many documentations.

Version:

version.BuildInfo{Version:"v3.0.0-beta.3", GitCommit:"5cb923eecbe80d1ad76399aee234717c11931d9a", GitTreeState:"clean", GoVersion:"go1.12.9"}

Platform: Windows 10 64

What could be the reason?

Charlie
  • 22,886
  • 11
  • 59
  • 90
  • 1
    Helm v3 is still beta. Maybe in v3 they removed the `--name` flag from `helm install`, or handle flag parsing differently? Most of the docs you're finding are for Helm v2 and they may not work with Helm v3. What output do you see if you run `helm install -h`? Does it show a `--name` flag? Does it show that it still accepts flags at the end of the command? – Amit Kumar Gupta Sep 16 '19 at 16:59
  • 4
    Also you can search the Helm GitHub repo for issues with your error message. For example [this search](https://github.com/helm/helm/issues?utf8=%E2%9C%93&q=%22unknown+flag%3A+--name%22) results in [this issue](https://github.com/helm/helm/issues/6019) entitled "Helm 3 changed release name parameter of `helm template`". In fact, doing a basic Internet search for the phrase `Helm "unknown flag: --name"` brings up the same issue as the top result. – Amit Kumar Gupta Sep 16 '19 at 17:01
  • Possible duplicate of [Helm V3 - Cannot find the official repo](https://stackoverflow.com/questions/57970255/helm-v3-cannot-find-the-official-repo) – Jakub Sep 17 '19 at 10:00
  • @jt97: How is this remotely related? The questions are completely different, and caused by different things. – Jonathan Hall Nov 27 '19 at 17:31

5 Answers5

170

In Helm v3, the release name is now mandatory as part of the commmand, see helm install --help:

Usage:
helm install [NAME] [CHART] [flags]

Your command should be:

helm install my-nginx stable/nginx-ingress


Furthermore, Helm will not auto-generate names for releases anymore. If you want the "old behavior", you can use the --generate-name flag. e.g:

helm install --generate-name stable/nginx-ingress

The v3 docs are available at https://v3.helm.sh/docs/, but as it is a beta version, the docs will not be accurate for a while. It's better to rely on the CLI --help, that is auto-generated by Go/Cobra.

Eduardo Baitello
  • 10,469
  • 7
  • 46
  • 74
  • 1
    Thanks for the answer. But `helm install my-nginx stable/nginx-ingress` doesn't still work. It says it cannot find the chart. Any workaround? – Charlie Sep 17 '19 at 07:17
  • 5
    Please use `helm repo add stable https://kubernetes-charts.storage.googleapis.com/` Then u can check for all charts by using `helm search repo stable` and install them by `helm install` command above. – Jakub Sep 17 '19 at 10:27
  • Jakub commet was helpful. However the URL no longer exists. Must use https://charts.helm.sh/stable. I assume this will change over time again. – Dave Mar 23 '21 at 14:24
28

The --name flag is no more in version 3.

It should be

helm install my-nginx stable/nginx-ingress

Syntax:

help install [name] [chart]

Charlie
  • 22,886
  • 11
  • 59
  • 90
  • Though we thank you for your answer, it would be better if it provided additional value on top of the other answers. In this case, your answer does not provide additional value, since the accepted answer already had that solution. If a previous answer was helpful to you, you should [vote it up](https://stackoverflow.com/help/privileges/vote-up). – Eduardo Baitello Dec 05 '19 at 20:15
  • 2
    Thanks - The additional value it provides is the quick grasp. Anyone who comes here can look at this answer and get to the solution within 5 seconds. Which is what I was looking for when I asked this question FYI - I up voted the accepted answer and accepted that too. – Charlie Dec 06 '19 at 05:54
0

I don't think the helm3 does support "--name" argument. As per the helm3 doc, the command to install a package and expected output is given down below:

$ helm install happy-panda bitnami/wordpress
NAME: happy-panda
LAST DEPLOYED: Tue Jan 26 10:27:17 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
** Please be patient while the chart is being deployed **

Here "happy-panda" is the name of the release and "bitnami/wordpress" is the name of the chart. Also you can generate name for the release by using --generate-name flag.

Dipto Mondal
  • 624
  • 1
  • 4
  • 14
0

As others have mentioned, there is no --name flag in version 3 of Helm. Also, Helm v3 comes without stable repository setup by default. The best way to discover a chart by searching the Artifact Hub. Once you find the repo, which hosts the chart you are looking for, you need to add the repo as:

helm repo add nginx-stable https://helm.nginx.com/stable

And then you can install chart

helm install my-nginx nginx-stable/nginx-ingress
Pankaj
  • 2,220
  • 1
  • 19
  • 31
0

As name was made compulsory in helm3, if we do helm repo --help,

help install [name] [chart]

If the chart was not present,

  1. use helm repo add <name> <url>
  2. then use helm install