88
votes

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?

4
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
Also you can search the Helm GitHub repo for issues with your error message. For example this search results in this issue 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
@jt97: How is this remotely related? The questions are completely different, and caused by different things.Flimzy

4 Answers

152
votes

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.

22
votes

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

It should be

helm install my-nginx stable/nginx-ingress

Syntax:

help install [name] [chart]

0
votes

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.

0
votes

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