头盔安装未知标志——名称

当我试图安装一个带头盔的图表时:

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

我得到了一个错误:

错误: 未知标志: —— name

但是我在许多文档中看到了上面的命令格式。

版本:

版本.BuildInfo {版本: “ v3.0.0-beta.3”, GitCommit: “5cb923eecbe80d1ad76399aee234717c11931d9a”, GitTreeState: “ clean”,GoVersion: “ go1.12.9”}

平台: Windows 1064

原因是什么?

76625 次浏览

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.

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

It should be

helm install my-nginx stable/nginx-ingress

Syntax:

help install [name] [chart]

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.

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

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