kubernetes gcp

Error: helm install unknown flag: –name

This tutorial provides clarification on how to deal with error helm install unknown flag: –name while trying to install a chart using helm in GKE cluster.

Error: helm install unknown flag: –name

I tried downloading a demo application from git hub as shown below.

$ git clone https://github.com/cloudnativedevops/demo.git
Cloning into 'demo'...
remote: Enumerating objects: 885, done.
remote: Total 885 (delta 0), reused 0 (delta 0), pack-reused 885
Receiving objects: 100% (885/885), 330.78 KiB | 13.78 MiB/s, done.
Resolving deltas: 100% (363/363), done.

Then, tried to install the demo application from the following location.

~/demo/hello-helm/k8s/demo (sneppets)$ ls
Chart.yaml  production-values.yaml  staging-values.yaml  templates  values.yaml

Below is the helm command I ran to install the demo application. But it failed with error: unknown flag: –name as shown below.

$ helm install --name demo /home/sneppets/demo/hello-helm/k8s/demo/

Error: unknown flag: --name

Troubleshoot unknown flag –name error

To check how to use helm install command, you can run the following command. This command will provide information on the usage and flags that you could use.

$ helm install --help

Find out your Helm version.

$ helm version

version.BuildInfo{Version:"v3.5.0", GitCommit:"32c22239423b3b4ba6706d450bd044baffdcf9e6", GitTreeState:"clean", GoVersion:"go1.15.6"}

From the Usage guideline it is clear that in Helm version 3.5.0, the release name is not optional and it is mandatory. Therefore you are not allowed to use –-name flag i.e., –name flag is removed.

  helm install [NAME] [CHART] [flags]

Since release name is now mandatory from Helm V3, your helm chart install command should be.

$ helm install demo /home/sneppets/demo/hello-helm/k8s/demo/
NAME: demo
LAST DEPLOYED: Mon Apr  5 11:59:30 2021
NAMESPACE: default
STATUS: deployed

To auto-generate release names you need to use the following command.

$ helm install --generate-name /home/nithip/demo/hello-helm/k8s/demo/
NAME: demo-1617624202
LAST DEPLOYED: Mon Apr  5 12:03:23 2021
NAMESPACE: default
STATUS: deployed

$ helm ls
NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
demo-1617624202 default         1               2021-04-05 12:03:23.783443044 +0000 UTC deployed        demo-1.0.1

After running the helm install command, you could see that Helm would have created a deployment resource which will start a Pod and created a Service.

Note, the helm install command creates deployment resource (Pod) and a Service by creating a Kubernetes object called Helm release.

That’s it. You had learnt how to deal with error unknown flag: –name while trying to install a helm chart.

Hope it helped 🙂

You’ll also like:


Inline Feedbacks
View all comments