Helm install unknown flag --name

KubernetesKubernetes Helm

Kubernetes Problem Overview


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?

Kubernetes Solutions


Solution 1 - Kubernetes

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.

Solution 2 - Kubernetes

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

It should be

helm install my-nginx stable/nginx-ingress

Syntax:

> help install [name] [chart]

Solution 3 - Kubernetes

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.

Solution 4 - Kubernetes

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

Solution 5 - Kubernetes

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCharlieView Question on Stackoverflow
Solution 1 - KubernetesEduardo BaitelloView Answer on Stackoverflow
Solution 2 - KubernetesCharlieView Answer on Stackoverflow
Solution 3 - KubernetesDipto MondalView Answer on Stackoverflow
Solution 4 - KubernetesPankajView Answer on Stackoverflow
Solution 5 - KubernetesKailash 1999View Answer on Stackoverflow