helm命令大全

1. helm命令大全

官网:https://helm.sh/

Helm是Kubernetes的包管理器。

1.1. helm环境变量

名称 描述
$HELM_CACHE_HOME 设置一个存储缓存文件的可选位置
$HELM_CONFIG_HOME 设置一个存储Helm配置的可选位置
$HELM_DATA_HOME 设置一个存储Helm数据的可选位置
$HELM_DEBUG 表示Helm是否在Debug模式系运行
$HELM_DRIVER 设置后台存储驱动,值包括:configmap, secret, memory, postgres
$HELM_DRIVER_SQL_CONNECTION_STRING 设置SQL存储驱动使用连接字符串
$HELM_MAX_HISTORY 设置发布历史记录的最大值
$HELM_NAMESPACE 设置用于helm操作的命名空间
$HELM_NO_PLUGINS 禁用插件,HELM_NO_PLUGINS=1 表示禁用插件
$HELM_PLUGINS 设置插件目录路径
$HELM_REGISTRY_CONFIG 设置注册配置文件的路径
$HELM_REPOSITORY_CACHE 设置仓库缓存目录路径
$HELM_REPOSITORY_CONFIG 设置仓库文件的路径
$KUBECONFIG 设置Kubernetes的可选配置文件(默认是”~/.kube/config”)
$HELM_KUBEAPISERVER 设置用于身份认证的Kubernetes API服务端
$HELM_KUBECAFILE 设置Kubernetes证书机构文件
$HELM_KUBEASGROUPS 使用逗号分隔的列表设置用于模拟的组
$HELM_KUBEASUSER 为操作设置要模拟的用户名
$HELM_KUBECONTEXT 设置kubeconfig上下文的名称
$HELM_KUBETOKEN 设置用于身份验证的不记名KubeToken

1.1.1. helm缓存顺序

Helm 基于以下配置顺序存储缓存,配置和添加数据:

  • 如果设置了 HELM_*_HOME 环境变量,则使用该变量
  • 否则,在支持XDG基本目录规范的系统上,会使用XDG变量
  • 当没有设置其他位置时,将根据操作系统使用默认位置

1.1.2. helm默认目录

默认情况下,默认目录取决于操作系统,默认值如下:

操作系统 缓存路径 配置路径 数据路径
Linux $HOME/.cache/helm $HOME/.config/helm $HOME/.local/share/helm
macOS $HOME/Library/Caches/helm $HOME/Library/Preferences/helm $HOME/Library/helm
Windows %TEMP%\helm %APPDATA%\helm %APPDATA%\helm

1.1.3. 可选项

1
2
3
4
5
6
7
8
9
10
11
12
13
    --debug                       enable verbose output
-h, --help help for helm
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.2. helm仓库

1.2.1. helm repo

添加、列出、删除、更新和索引chart仓库

1.2.2. 简介

该命令由于chart仓库交互的多条子命令组成

可以用来添加、删除、列举和索引chart仓库

1.2.3. 可选项

1
-h, --help   help for repo

1.2.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.3. helm仓库列表

1.3.1. helm repo list

列举chart仓库

1
helm repo list [flags]

1.3.2. 可选项

1
2
-h, --help            help for list
-o, --output format prints the output in the specified format. Allowed values: table, json, yaml (default table)

1.3.3. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.4. Helm 仓库更新

1.4.1. helm repo update

从chart仓库中更新本地可用chart的信息

1.4.2. 简介

更新从各自chart仓库中获取的有关chart的最新信息。信息会缓存在本地,被诸如’helm search’等命令使用。

1
helm repo update [flags]

1.4.3. 可选项

1
-h, --help   help for update

1.4.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.5. Helm 仓库索引

1.5.1. helm repo index

基于包含打包chart的目录,生成索引文件

1.5.2. 简介

读取当前目录,并根据找到的 chart 生成索引文件。

这个工具用来为chart仓库创建一个’index.yaml’文件,使用’–url’参数创建一个chart的绝对URL。

要合并生成的索引和已经存在的索引文件时,使用’–merge’参数。在这个场景中,在当前目录中找到的chart会合并到已有索引中, 本地chart的优先级高于已有chart。

1
helm repo index [DIR] [flags]

1.5.3. 可选项

1
2
3
-h, --help           help for index
--merge string merge the generated index into the given index
--url string url of chart repository

1.5.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.6. Helm 依赖

1.6.1. helm dependency

管理chart依赖

1.6.2. 简介

管理chart依赖

Helm chart将依赖存储在’charts/‘。对于chart开发者,管理依赖比声明了所有依赖的’Chart.yaml’文件更容易。

依赖命令对该文件进行操作,使得存储在’charts/‘目录的需要的依赖和实际依赖之间同步变得很容易。

比如Chart.yaml声明了两个依赖:

1
2
3
4
5
6
7
8
# Chart.yaml
dependencies:
- name: nginx
version: "1.2.3"
repository: "https://example.com/charts"
- name: memcached
version: "3.2.1"
repository: "https://another.example.com/charts"

‘name’是chart名称,必须匹配’Chart.yaml’文件中名称。

‘version’字段应该包含一个语义化的版本或版本范围。

‘repository’的URL应该指向Chart仓库。Helm希望通过附加’/index.yaml’到URL,应该能检索chart库索引。 注意:’repository’不能是别名。别名必须以’alias:’或‘@’开头。

从2.2.0开始,仓库可以被定义为本地存储的依赖chart的目录路径。路径应该以”file://“前缀开头,比如:

1
2
3
4
5
# Chart.yaml
dependencies:
- name: nginx
version: "1.2.3"
repository: "file://../dependency_chart/nginx"

如果在本地检索依赖chart,不需要使用”helm add repo”将仓库加入到helm。该示例中也支持版本匹配》。

1.6.3. 可选项

1
-h, --help   help for dependency

1.6.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.7. Helm 依赖列表

1.7.1. helm dependency list

列举指定chart的依赖

1.7.2. 简介

列举所有的chart中声明的依赖

该命令可以将chart包或chart目录作为输入,不会修改chart的内容。

如果chart不能加载会产生错误。

1
helm dependency list CHART [flags]

1.7.3. 可选项

1
-h, --help   help for list

1.7.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.8. Helm 列表

1.8.1. helm list

列举发布版本

1.8.2. 简介

该命令会列举出指定命名空间的所有发布版本,(如果没有指定命名空间,会使用当前命名空间)。

默认情况下,只会列举出部署的或者失败的发布,像’–uninstalled’或者’–all’会修改默认行为。这些参数可以组合使用:’–uninstalled –failed’。

默认情况下,列表按字母排序。使用’-d’参数按照日期排序。

如果使用–filter参数,会作为一个过滤器。过滤器是应用于发布列表的正则表达式(兼容Perl)。只有过滤器匹配的才会返回。

1
2
3
$ helm list --filter 'ara[a-z]+'
NAME UPDATED CHART
maudlin-arachnid 2020-06-18 14:17:46.125134977 +0000 UTC alpine-0.1.0

如果未找到结果,’helm list’会退出,但是没有输出(或者使用’-q’,只返回头部)。

默认情况下,最多返回256项,使用’–max’限制数量,’–max’设置为0不会返回所有结果,而是返回服务器默认值,可能要比256更多。 同时使用’–max’和’–offset’参数可以翻页显示。

1
helm list [flags]

1.8.3. 可选项

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-a, --all                  show all releases without any filter applied
-A, --all-namespaces list releases across all namespaces
-d, --date sort by release date
--deployed show deployed releases. If no other is specified, this will be automatically enabled
--failed show failed releases
-f, --filter string a regular expression (Perl compatible). Any releases that match the expression will be included in the results
-h, --help help for list
-m, --max int maximum number of releases to fetch (default 256)
--offset int next release index in the list, used to offset from start value
-o, --output format prints the output in the specified format. Allowed values: table, json, yaml (default table)
--pending show pending releases
-r, --reverse reverse the sort order
-l, --selector string Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Works only for secret(default) and configmap storage backends.
-q, --short output short (quiet) listing format
--superseded show superseded releases
--time-format string format time using golang time formatter. Example: --time-format "2006-01-02 15:04:05Z0700"
--uninstalled show uninstalled releases (if 'helm uninstall --keep-history' was used)
--uninstalling show releases that are currently being uninstalled

1.8.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.9. Helm 删除仓库

1.9.1. helm repo remove

删除一个或多个仓库

1
helm repo remove [REPO1 [REPO2 ...]] [flags]

1.9.2. 可选项

1
-h, --help   help for remove

1.9.3. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.10. Helm 包

1.10.1. helm package

将chart目录打包到chart归档中

1.10.2. 简介

该命令将chart打包成一个chart版本包文件。如果给定路径,就会在该路径中查找chart(必须包含Chart.yaml文件)然后将目录打包。

chart版本包会用于Helm包仓库。

要签名一个chart,使用’–sign’参数,在大多数场景中,也要提供’–keyring path/to/secret/keys’和’–key keyname’。

$ helm package –sign ./mychart –key mykey –keyring ~/.gnupg/secring.gpg

如果’–keyring’未指定,除非配置了其他方式,不然Helm通常会指定公共秘钥环。

1
helm package [CHART_PATH] [...] [flags]

1.10.3. 可选项

1
2
3
4
5
6
7
8
9
    --app-version string       set the appVersion on the chart to this version
-u, --dependency-update update dependencies from "Chart.yaml" to dir "charts/" before packaging
-d, --destination string location to write the chart. (default ".")
-h, --help help for package
--key string name of the key to use when signing. Used if --sign is true
--keyring string location of a public keyring (default "~/.gnupg/pubring.gpg")
--passphrase-file string location of a file which contains the passphrase for the signing key. Use "-" in order to read from stdin.
--sign use a PGP private key to sign this package
--version string set the version on the chart to this semver version

1.10.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.11. Helm 升级

1.11.1. helm upgrade

升级版本

1.11.2. 简介

该命令将发布升级到新版的chart。

升级参数必须是发布和chart。chart参数可以是:chart引用(‘example/mariadb’),chart目录路径,打包的chart或者完整URL。 对于chart引用,除非使用’–version’参数指定,否则会使用最新版本。

要在chart中重写value,需要使用’–values’参数并传一个文件或者从命令行使用’–set’参数传个配置, 要强制字符串值,使用’–set-string’。在值很大而不想使用’–values’和’–set’的场景中,使用’–set-file’从文件中读取单个的大值。

可以多次指定’–values’/‘-f’参数,最后(最右边)指定的文件优先级最高。比如如果myvalues.yaml和override.yaml同时包含了名为 ‘Test’的key,override.yaml中的设置会优先使用:

1
$ helm upgrade -f myvalues.yaml -f override.yaml redis ./redis

可以多次指定’–set’参数,最后(最右边)指定的优先级最高。比如’bar’ 和 ‘newbar’都设置了一个名为’foo’的可以, ‘newbar’的值会优先使用:

1
2
    $ helm upgrade --set foo=bar --set foo=newbar redis ./redis
helm upgrade [RELEASE] [CHART] [flags]

组合使用 ‘–debug’ 和 ‘–dry-run’ 可以在不升级chart的情况下检查生成的清单。

注意: 在crds/目录中的CRD清单不能用 --dry-run 验证。查看 Helm’s CRDs caveats 获取更多信息。

1.11.3. 可选项

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    --atomic                       if set, upgrade process rolls back changes made in case of failed upgrade. The --wait flag will be set automatically if --atomic is used
--ca-file string verify certificates of HTTPS-enabled servers using this CA bundle
--cert-file string identify HTTPS client using this SSL certificate file
--cleanup-on-fail allow deletion of new resources created in this upgrade when upgrade fails
--create-namespace if --install is set, create the release namespace if not present
--description string add a custom description
--devel use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored
--disable-openapi-validation if set, the upgrade process will not validate rendered templates against the Kubernetes OpenAPI Schema
--dry-run simulate an upgrade
--force force resource updates through a replacement strategy
-h, --help help for upgrade
--history-max int limit the maximum number of revisions saved per release. Use 0 for no limit (default 10)
--insecure-skip-tls-verify skip tls certificate checks for the chart download
-i, --install if a release by this name doesn't already exist, run an install
--key-file string identify HTTPS client using this SSL key file
--keyring string location of public keys used for verification (default "~/.gnupg/pubring.gpg")
--no-hooks disable pre/post upgrade hooks
-o, --output format prints the output in the specified format. Allowed values: table, json, yaml (default table)
--pass-credentials pass credentials to all domains
--password string chart repository password where to locate the requested chart
--post-renderer postrenderer the path to an executable to be used for post rendering. If it exists in $PATH, the binary will be used, otherwise it will try to look for the executable at the given path (default exec)
--render-subchart-notes if set, render subchart notes along with the parent
--repo string chart repository url where to locate the requested chart
--reset-values when upgrading, reset the values to the ones built into the chart
--reuse-values when upgrading, reuse the last release's values and merge in any overrides from the command line via --set and -f. If '--reset-values' is specified, this is ignored
--set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--skip-crds if set, no CRDs will be installed when an upgrade is performed with install flag enabled. By default, CRDs are installed if not already present, when an upgrade is performed with install flag enabled
--timeout duration time to wait for any individual Kubernetes operation (like Jobs for hooks) (default 5m0s)
--username string chart repository username where to locate the requested chart
-f, --values strings specify values in a YAML file or a URL (can specify multiple)
--verify verify the package before using it
--version string specify a version constraint for the chart version to use. This constraint can be a specific tag (e.g. 1.1.1) or it may reference a valid range (e.g. ^2.0.0). If this is not specified, the latest version is used
--wait if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet are in a ready state before marking the release as successful. It will wait for as long as --timeout
--wait-for-jobs if set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. It will wait for as long as --timeout

1.11.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.12. Helm 卸载

1.12.1. helm uninstall

卸载版本

1.12.2. 简介

该命令使用版本名称卸载版本

会删除与最新版本chart相关的所有资源以及发布历史,释放以供将来使用

使用’–dry-run’参数查看哪些版本将在不实际卸载的情况下能够被卸载

1
helm uninstall RELEASE_NAME [...] [flags]

1.12.3. 可选项

1
2
3
4
5
6
    --description string   add a custom description
--dry-run simulate a uninstall
-h, --help help for uninstall
--keep-history remove all associated resources and mark the release as deleted, but retain the release history
--no-hooks prevent hooks from running during uninstallation
--timeout duration time to wait for any individual Kubernetes operation (like Jobs for hooks) (default 5m0s)

1.12.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.13. Helm 历史

1.13.1. helm history

检索发布历史

1.13.2. 简介

打印给定版本的历史修订。

默认会返回最大的256个历史版本。设置’–max’配置返回历史列表的最大长度。

历史发布集合会被打印成格式化的表格,例如:

1
2
3
4
5
6
7
$ helm history angry-bird
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION
1 Mon Oct 3 10:15:13 2016 superseded alpine-0.1.0 1.0 Initial install
2 Mon Oct 3 10:15:13 2016 superseded alpine-0.1.0 1.0 Upgraded successfully
3 Mon Oct 3 10:15:13 2016 superseded alpine-0.1.0 1.0 Rolled back to 2
4 Mon Oct 3 10:15:13 2016 deployed alpine-0.1.0 1.0 Upgraded successfully
helm history RELEASE_NAME [flags]

1.13.3. 可选项

1
2
3
-h, --help            help for history
--max int maximum number of revision to include in history (default 256)
-o, --output format prints the output in the specified format. Allowed values: table, json, yaml (default table)

1.13.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.14. Helm 变量

1.14.1. helm env

helm 客户端环境信息

1.14.2. 简介

Env 打印所有Helm使用的环境信息

1
helm env [flags]

1.14.3. 可选项

1
-h, --help   help for env

1.14.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.15. Helm 回滚

1.15.1. helm rollback

回滚发布到上一个版本

1.15.2. 简介

该命令回滚发布到上一个版本

回滚命令的第一个参数是发布的名称,第二是修订(版本)号,如果省略此参数,会回滚到上一个版本。

要查看修订号,执行’helm history RELEASE’。

1
helm rollback <RELEASE> [REVISION] [flags]

1.15.3. 可选项

1
2
3
4
5
6
7
8
9
10
    --cleanup-on-fail    allow deletion of new resources created in this rollback when rollback fails
--dry-run simulate a rollback
--force force resource update through delete/recreate if needed
-h, --help help for rollback
--history-max int limit the maximum number of revisions saved per release. Use 0 for no limit (default 10)
--no-hooks prevent hooks from running during rollback
--recreate-pods performs pods restart for the resource if applicable
--timeout duration time to wait for any individual Kubernetes operation (like Jobs for hooks) (default 5m0s)
--wait if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet are in a ready state before marking the release as successful. It will wait for as long as --timeout
--wait-for-jobs if set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. It will wait for as long as --timeout

1.15.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.16. Helm 安装

1.16.1. helm install

安装chart

1.16.2. 简介

该命令用于安装chart包。

安装参数必须是chart的引用,一个打包后的chart路径,未打包的chart目录或者是一个URL。

要重写chart中的值,使用’–values’参数传递一个文件或者使用’–set’参数在命令行传递配置,强制使用字符串要用’–set-string’。 示例中要是值太大,则您既不想用’–values’也不想用’–set’,使用’–set-file’从文件中读取单个较大的值。

1
$ helm install -f myvalues.yaml myredis ./redis

或者

1
$ helm install --set name=prod myredis ./redis

或者

1
$ helm install --set-string long_int=1234567890 myredis ./redis

或者

1
$ helm install --set-file my_script=dothings.sh myredis ./redis

你可以多次指定’–values’/‘-f’参数。最右侧指定的文件优先级最高。比如,如果两个文件myvalues.yaml和override.yaml 都包含名为’Test’的可以,override.yaml中的值优先:

1
$ helm install -f myvalues.yaml -f override.yaml  myredis ./redis

可以指定’–set’参数多次,最右边的参数优先级最高,比如,’bar’和’newbar’都设置了一个名为’foo’的可以,’newbar’的值优先:

1
$ helm install --set foo=bar --set foo=newbar  myredis ./redis

为了检测生成的清单,但并不安装到chart,可以将’–debug’和’–dry-run’组合使用。

注意: 在crds/目录中的CRD清单不能用 --dry-run 验证。查看 Helm’s CRDs caveats 获取更多信息。

如果设置了–verify,chart必须有出处文件,且出处文件必须传递所有的验证步骤。

有五种不同的方式来标识需要安装的chart:

  1. 通过chart引用: helm install mymaria example/mariadb
  2. 通过chart包: helm install mynginx ./nginx-1.2.3.tgz
  3. 通过未打包chart目录的路径: helm install mynginx ./nginx
  4. 通过URL绝对路径: helm install mynginx https://example.com/charts/nginx-1.2.3.tgz
  5. 通过chart引用和仓库url: helm install –repo https://example.com/charts/ mynginx nginx

CHART引用

chart引用是在chart仓库中引用chart的一种方便方式。

当你用仓库前缀(‘example/mariadb’)引用chart时,Helm会在本地配置查找名为 ‘example’ 的chart仓库, 然后会在仓库中查找名为’mariadb’的仓库,然后会安装这个chart最新的稳定版本,除非指定了’–devel’参数且包含了开发版本(alpha, beta,和候选版本),或者使用’–version’参数提供一个版本号。

要查看仓库列表,使用’helm repo list’。要在仓库中搜索chart,使用’helm search’。

1
helm install [NAME] [CHART] [flags]

1.16.3. 可选项

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
    --atomic                       if set, the installation process deletes the installation on failure. The --wait flag will be set automatically if --atomic is used
--ca-file string verify certificates of HTTPS-enabled servers using this CA bundle
--cert-file string identify HTTPS client using this SSL certificate file
--create-namespace create the release namespace if not present
--dependency-update run helm dependency update before installing the chart
--description string add a custom description
--devel use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored
--disable-openapi-validation if set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema
--dry-run simulate an install
-g, --generate-name generate the name (and omit the NAME parameter)
-h, --help help for install
--insecure-skip-tls-verify skip tls certificate checks for the chart download
--key-file string identify HTTPS client using this SSL key file
--keyring string location of public keys used for verification (default "~/.gnupg/pubring.gpg")
--name-template string specify template used to name the release
--no-hooks prevent hooks from running during install
-o, --output format prints the output in the specified format. Allowed values: table, json, yaml (default table)
--pass-credentials pass credentials to all domains
--password string chart repository password where to locate the requested chart
--post-renderer postrenderer the path to an executable to be used for post rendering. If it exists in $PATH, the binary will be used, otherwise it will try to look for the executable at the given path (default exec)
--render-subchart-notes if set, render subchart notes along with the parent
--replace re-use the given name, only if that name is a deleted release which remains in the history. This is unsafe in production
--repo string chart repository url where to locate the requested chart
--set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--skip-crds if set, no CRDs will be installed. By default, CRDs are installed if not already present
--timeout duration time to wait for any individual Kubernetes operation (like Jobs for hooks) (default 5m0s)
--username string chart repository username where to locate the requested chart
-f, --values strings specify values in a YAML file or a URL (can specify multiple)
--verify verify the package before using it
--version string specify a version constraint for the chart version to use. This constraint can be a specific tag (e.g. 1.1.1) or it may reference a valid range (e.g. ^2.0.0). If this is not specified, the latest version is used
--wait if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet are in a ready state before marking the release as successful. It will wait for as long as --timeout

1.16.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.17. Helm 展示

1.17.1. helm show

显示chart信息

1.17.2. 简介

该命令由多条子命令组成来显示chart的信息

1.17.3. 可选项

1
-h, --help   help for show

1.17.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.18. Helm 展示chart

1.18.1. helm show chart

显示chart定义

1.18.2. 简介

该命令检查chart(目录、文件或URL)并显示Charts.yaml文件的内容

1
helm show chart [CHART] [flags]

1.18.3. 可选项

1
2
3
4
5
6
7
8
9
10
11
12
13
    --ca-file string             verify certificates of HTTPS-enabled servers using this CA bundle
--cert-file string identify HTTPS client using this SSL certificate file
--devel use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored
-h, --help help for chart
--insecure-skip-tls-verify skip tls certificate checks for the chart download
--key-file string identify HTTPS client using this SSL key file
--keyring string location of public keys used for verification (default "~/.gnupg/pubring.gpg")
--pass-credentials pass credentials to all domains
--password string chart repository password where to locate the requested chart
--repo string chart repository url where to locate the requested chart
--username string chart repository username where to locate the requested chart
--verify verify the package before using it
--version string specify a version constraint for the chart version to use. This constraint can be a specific tag (e.g. 1.1.1) or it may reference a valid range (e.g. ^2.0.0). If this is not specified, the latest version is used

1.18.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.19. Helm 展示readme

1.19.1. helm show readme

显示chart的README

1.19.2. 简介

该命令检查chart(目录、文件或URL)并显示README文件内容

1
helm show readme [CHART] [flags]

1.19.3. 可选项

1
2
3
4
5
6
7
8
9
10
11
12
13
    --ca-file string             verify certificates of HTTPS-enabled servers using this CA bundle
--cert-file string identify HTTPS client using this SSL certificate file
--devel use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored
-h, --help help for readme
--insecure-skip-tls-verify skip tls certificate checks for the chart download
--key-file string identify HTTPS client using this SSL key file
--keyring string location of public keys used for verification (default "~/.gnupg/pubring.gpg")
--pass-credentials pass credentials to all domains
--password string chart repository password where to locate the requested chart
--repo string chart repository url where to locate the requested chart
--username string chart repository username where to locate the requested chart
--verify verify the package before using it
--version string specify a version constraint for the chart version to use. This constraint can be a specific tag (e.g. 1.1.1) or it may reference a valid range (e.g. ^2.0.0). If this is not specified, the latest version is used

1.19.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.20. Helm 展示value

1.20.1. helm show values

显示chart的values

1.20.2. 简介

该命令检查chart(目录、文件或URL)并显示values.yaml文件的内容

1
helm show values [CHART] [flags]

1.20.3. 可选项

1
2
3
4
5
6
7
8
9
10
11
12
13
14
    --ca-file string             verify certificates of HTTPS-enabled servers using this CA bundle
--cert-file string identify HTTPS client using this SSL certificate file
--devel use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored
-h, --help help for values
--insecure-skip-tls-verify skip tls certificate checks for the chart download
--jsonpath string supply a JSONPath expression to filter the output
--key-file string identify HTTPS client using this SSL key file
--keyring string location of public keys used for verification (default "~/.gnupg/pubring.gpg")
--pass-credentials pass credentials to all domains
--password string chart repository password where to locate the requested chart
--repo string chart repository url where to locate the requested chart
--username string chart repository username where to locate the requested chart
--verify verify the package before using it
--version string specify a version constraint for the chart version to use. This constraint can be a specific tag (e.g. 1.1.1) or it may reference a valid range (e.g. ^2.0.0). If this is not specified, the latest version is used

1.20.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.21. Helm 展示所有

1.21.1. helm show all

显示chart的所有信息

1.21.2. 简介

该命令检查chart(目录、文件或URL)并显示所有的内容(values.yaml, Charts.yaml, README)

1
helm show all [CHART] [flags]

1.21.3. 可选项

1
2
3
4
5
6
7
8
9
10
11
12
13
    --ca-file string             verify certificates of HTTPS-enabled servers using this CA bundle
--cert-file string identify HTTPS client using this SSL certificate file
--devel use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored
-h, --help help for all
--insecure-skip-tls-verify skip tls certificate checks for the chart download
--key-file string identify HTTPS client using this SSL key file
--keyring string location of public keys used for verification (default "~/.gnupg/pubring.gpg")
--pass-credentials pass credentials to all domains
--password string chart repository password where to locate the requested chart
--repo string chart repository url where to locate the requested chart
--username string chart repository username where to locate the requested chart
--verify verify the package before using it
--version string specify a version constraint for the chart version to use. This constraint can be a specific tag (e.g. 1.1.1) or it may reference a valid range (e.g. ^2.0.0). If this is not specified, the latest version is used

1.21.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.22. Helm 拉取

1.22.1. helm pull

从仓库下载并(可选)在本地目录解压

1.22.2. 简介

从包仓库中检索包并下载到本地。

对于要获取检查,修改或重新打包的包很有用,还可以用于在不安装chart的情况下对chart进行加密验证。

下载chart之后有解压的选项,会为chart创建一个目录并解压到这个目录中。

如果指定了–verify参数,请求的chart必须有出处文件,且必须通过验证。任意部分的失败都会导致错误,且chart不会在本地保存。

1
helm pull [chart URL | repo/chartname] [...] [flags]

1.22.3. 可选项

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
    --ca-file string             verify certificates of HTTPS-enabled servers using this CA bundle
--cert-file string identify HTTPS client using this SSL certificate file
-d, --destination string location to write the chart. If this and tardir are specified, tardir is appended to this (default ".")
--devel use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.
-h, --help help for pull
--insecure-skip-tls-verify skip tls certificate checks for the chart download
--key-file string identify HTTPS client using this SSL key file
--keyring string location of public keys used for verification (default "~/.gnupg/pubring.gpg")
--pass-credentials pass credentials to all domains
--password string chart repository password where to locate the requested chart
--prov fetch the provenance file, but don't perform verification
--repo string chart repository url where to locate the requested chart
--untar if set to true, will untar the chart after downloading it
--untardir string if untar is specified, this flag specifies the name of the directory into which the chart is expanded (default ".")
--username string chart repository username where to locate the requested chart
--verify verify the package before using it
--version string specify a version constraint for the chart version to use. This constraint can be a specific tag (e.g. 1.1.1) or it may reference a valid range (e.g. ^2.0.0). If this is not specified, the latest version is used

1.22.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.23. Helm 插件

1.23.1. helm plugin

安装、列举或卸载Helm插件

1.23.2. 简介

管理客户端插件。

1.23.3. 可选项

1
-h, --help   help for plugin

1.23.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.24. Helm 插件列表

1.24.1. helm plugin list

列举已安装的Helm插件

1
helm plugin list [flags]

1.24.2. 可选项

1
-h, --help   help for list

1.24.3. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.25. Helm 插件升级

1.25.1. helm plugin update

升级一个或多个Helm插件

1
helm plugin update <plugin>... [flags]

1.25.2. 可选项

1
-h, --help   help for update

1.25.3. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.26. Helm 插件卸载

1.26.1. helm plugin uninstall

卸载一个或多个Helm插件

1
helm plugin uninstall <plugin>... [flags]

1.26.2. 可选项

1
-h, --help   help for uninstall

1.26.3. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.27. Helm 插件安装

1.27.1. helm plugin install

安装一个或多个Helm插件

1.27.2. 简介

该命令允许您通过VCS仓库url或者本地路径安装插件。

1
helm plugin install [options] <path|url>... [flags]

1.27.3. 可选项

1
2
-h, --help             help for install
--version string specify a version constraint. If this is not specified, the latest version is installed

1.27.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.28. Helm 搜索

helm中搜索关键字

1.28.2. 简介

搜索提供了可以在已经添加的Artifact Hub和仓库等多个位置搜索Helm chart 的能力。

1.28.3. 可选项

1
-h, --help   help for search

1.28.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.29. Helm 搜索hub

1.29.1. helm search hub

在Artifact Hub或自己的hub实例中搜索chart

1.29.2. 简介

在Artifact Hub或自己的hub实例中搜索Helm charts。

Artifact Hub 是基于web页面的应用,支持CNCF项目的查找、安装和发布包及配置项,包括了公开发布的Helm chart。它是CNCF的沙盒项目。可以访问https://artifacthub.io/

[KEYWORD] 参数接受关键字字符串或者带引号的查询字符串。查询字符串的文档,请查看 [https://artifacthub.github.io/hub/api/?urls.primaryName=Monocular%20compatible%20search%20API#/Monocular/get_api_chartsvc_v1_charts_search](https://artifacthub.github.io/hub/api/?urls.primaryName=Monocular compatible search API#/Monocular/get_api_chartsvc_v1_charts_search)

之前的Helm版本使用Monocular实例作为默认的endpoint,因此为了向后兼容,Artifact Hub兼容Monocular的搜索API。类似地,要设置endpoint参数时,指定的endpoint也必须兼容Monocular的搜索API。 注意,指定Monocular实例作为endpoint时,不支持字符串查询。更多API细节,请参考 https://github.com/helm/monocular

1
helm search hub [KEYWORD] [flags]

1.29.3. 可选项

1
2
3
4
    --endpoint string      Hub instance to query for charts (default "https://hub.helm.sh")
-h, --help help for hub
--max-col-width uint maximum column width for output table (default 50)
-o, --output format prints the output in the specified format. Allowed values: table, json, yaml (default table)

1.29.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.30. Helm 搜索仓库

1.30.1. helm search repo

用chart中关键字搜索仓库

1.30.2. 简介

搜索会读取系统上配置的所有仓库,并查找匹配。搜索这些仓库会使用存储在系统中的元数据。

它会展示找到最新稳定版本的chart。如果指定了–devel参数,输出会包括预发布版本。

示例:

1
2
3
4
5
6
7
8
# Search for stable release versions matching the keyword "nginx"
$ helm search repo nginx

# Search for release versions matching the keyword "nginx", including pre-release versions
$ helm search repo nginx --devel

# Search for the latest stable release for nginx-ingress with a major version of 1
$ helm search repo nginx-ingress --version ^1.0.0

仓库使用’helm repo’命令管理。

1
helm search repo [keyword] [flags]

1.30.3. 可选项

1
2
3
4
5
6
7
    --devel                use development versions (alpha, beta, and release candidate releases), too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored
-h, --help help for repo
--max-col-width uint maximum column width for output table (default 50)
-o, --output format prints the output in the specified format. Allowed values: table, json, yaml (default table)
-r, --regexp use regular expressions for searching repositories you have added
--version string search using semantic versioning constraints on repositories you have added
-l, --versions show the long listing, with each version of each chart on its own line, for repositories you have added

1.30.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.31. Helm 模板

1.31.1. helm template

本地渲染模板

1.31.2. 简介

本地渲染模板并显示输出

通常在集群中查找或检索到的任何值都可以在本地伪造。另外,没有对chart有效性进行服务端测试。

1
helm template [NAME] [CHART] [flags]

1.31.3. 可选项

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
-a, --api-versions stringArray     Kubernetes api versions used for Capabilities.APIVersions
--atomic if set, the installation process deletes the installation on failure. The --wait flag will be set automatically if --atomic is used
--ca-file string verify certificates of HTTPS-enabled servers using this CA bundle
--cert-file string identify HTTPS client using this SSL certificate file
--create-namespace create the release namespace if not present
--dependency-update run helm dependency update before installing the chart
--description string add a custom description
--devel use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored
--disable-openapi-validation if set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema
--dry-run simulate an install
-g, --generate-name generate the name (and omit the NAME parameter)
-h, --help help for template
--include-crds include CRDs in the templated output
--insecure-skip-tls-verify skip tls certificate checks for the chart download
--is-upgrade set .Release.IsUpgrade instead of .Release.IsInstall
--key-file string identify HTTPS client using this SSL key file
--keyring string location of public keys used for verification (default "~/.gnupg/pubring.gpg")
--kube-version string Kubernetes version used for Capabilities.KubeVersion
--name-template string specify template used to name the release
--no-hooks prevent hooks from running during install
--output-dir string writes the executed templates to files in output-dir instead of stdout
--pass-credentials pass credentials to all domains
--password string chart repository password where to locate the requested chart
--post-renderer postrenderer the path to an executable to be used for post rendering. If it exists in $PATH, the binary will be used, otherwise it will try to look for the executable at the given path (default exec)
--release-name use release name in the output-dir path.
--render-subchart-notes if set, render subchart notes along with the parent
--replace re-use the given name, only if that name is a deleted release which remains in the history. This is unsafe in production
--repo string chart repository url where to locate the requested chart
--set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
-s, --show-only stringArray only show manifests rendered from the given templates
--skip-crds if set, no CRDs will be installed. By default, CRDs are installed if not already present
--skip-tests skip tests from templated output
--timeout duration time to wait for any individual Kubernetes operation (like Jobs for hooks) (default 5m0s)
--username string chart repository username where to locate the requested chart
--validate validate your manifests against the Kubernetes cluster you are currently pointing at. This is the same validation performed on an install
-f, --values strings specify values in a YAML file or a URL (can specify multiple)
--verify verify the package before using it
--version string specify a version constraint for the chart version to use. This constraint can be a specific tag (e.g. 1.1.1) or it may reference a valid range (e.g. ^2.0.0). If this is not specified, the latest version is used
--wait if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet are in a ready state before marking the release as successful. It will wait for as long as --timeout
--wait-for-jobs if set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. It will wait for as long as --timeout

1.31.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.32. Helm 测试

1.32.1. helm test

执行发布版本的测试

1.32.2. 简介

测试命令执行发布版本的测试

该命令使用的参数是部署版本的名称,要运行的测试在已安装的chart中定义。

1
helm test [RELEASE] [flags]

1.32.3. 可选项

1
2
3
4
    --filter strings     specify tests by attribute (currently "name") using attribute=value syntax or '!attribute=value' to exclude a test (can specify multiple or separate values with commas: name=test1,name=test2)
-h, --help help for test
--logs dump the logs from test pods (this runs after all tests are complete, but before any cleanup)
--timeout duration time to wait for any individual Kubernetes operation (like Jobs for hooks) (default 5m0s)

1.32.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.33. Helm 添加仓库

1.33.1. helm repo add

添加chart仓库

1
helm repo add [NAME] [URL] [flags]

1.33.2. 可选项

1
2
3
4
5
6
7
8
9
10
11
    --allow-deprecated-repos     by default, this command will not allow adding official repos that have been permanently deleted. This disables that behavior
--ca-file string verify certificates of HTTPS-enabled servers using this CA bundle
--cert-file string identify HTTPS client using this SSL certificate file
--force-update replace (overwrite) the repo if it already exists
-h, --help help for add
--insecure-skip-tls-verify skip tls certificate checks for the repository
--key-file string identify HTTPS client using this SSL key file
--no-update Ignored. Formerly, it would disabled forced updates. It is deprecated by force-update.
--pass-credentials pass credentials to all domains
--password string chart repository password
--username string chart repository username

1.33.3. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.34. Helm 版本

1.34.1. helm version

打印客户端版本信息

1.34.2. 简介

显示Helm的版本。

该命令会打印Helm的版本描述,输出如下:

version.BuildInfo{Version:”v3.2.1”, GitCommit:”fe51cd1e31e6a202cba7dead9552a6d418ded79a”, GitTreeState:”clean”, GoVersion:”go1.13.10”}

  • 版本是发布的语义化版本。
  • GitCommit是用于生成此版本提交的SHA
  • 如果构建二级制包是没有本地代码修改,GitTreeState就是”干净的”
  • GoVersion是用于编译Helm的Go版本

当使用–template参数时,下列属性在模板中是可用的:

  • .Version 包含了Helm的语义化版本
  • .GitCommit 是git的提交
  • .GitTreeState 是Helm构建时的git树结构
  • .GoVersion 包含Helm编译时使用的Go版本
1
helm version [flags]

1.34.3. 可选项

1
2
3
-h, --help              help for version
--short print the version number
--template string template for version string format

1.34.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.35. Helm 状态

1.35.1. helm status

显示已命名发布的状态

1.35.2. 简介

该命令显示已命名发布的状态,状态包括:

  • 最后部署时间
  • 发布版本所在的k8s命名空间
  • 发布状态(可以是: unknown, deployed, uninstalled, superseded, failed, uninstalling, pending-install, pending-upgrade 或 pending-rollback)
  • 发布版本修订
  • 发布版本描述(可以是完成信息或错误信息,需要用–show-desc启用)
  • 列举版本包含的资源,按类型排序
  • 最后一次测试套件运行的详细信息(如果使用)
  • chart提供的额外的注释
1
helm status RELEASE_NAME [flags]

1.35.3. 可选项

1
2
3
4
-h, --help            help for status
-o, --output format prints the output in the specified format. Allowed values: table, json, yaml (default table)
--revision int if set, display the status of the named release with revision
--show-desc if set, display the description message of the named release

1.35.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.36. Helm 获取所有

1.36.1. helm get all

下载命名版本的所有信息

1.36.2. 简介

该命令打印一个具有可读性的信息集合,包括注释,钩子,提供的values,以及给定版本生成的清单文件。

1
helm get all RELEASE_NAME [flags]

1.36.3. 可选项

1
2
3
-h, --help              help for all
--revision int get the named release with revision
--template string go template for formatting the output, eg: {{.Release.Name}}

1.36.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.37. Helm 获取扩展

1.37.1. helm get

下载发布的扩展信息

1.37.2. 简介

该命令有多个子命令组成,用来获取发布版本的扩展信息,包括:

  • 生成版本的值
  • 生成的清单文件
  • 发布的chart提供的注释
  • 与版本关联的钩子

1.37.3. 可选项

1
-h, --help   help for get

1.37.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.38. Helm 获取注释

1.38.1. helm get notes

下载命名版本的注释

1.38.2. 简介

该命令显示了由指定版本chart提供的注释

1
helm get notes RELEASE_NAME [flags]

1.38.3. 可选项

1
2
-h, --help           help for notes
--revision int get the named release with revision

1.38.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.39. Helm 获取清单

1.39.1. helm get manifest

下载命名版本的清单

1.39.2. 简介

该命令用来获取指定版本的清单文件

清单是由该版本的chart生成的Kubernetes资源的YAML编码表示。

1
helm get manifest RELEASE_NAME [flags]

1.39.3. 可选项

1
2
-h, --help           help for manifest
--revision int get the named release with revision

1.39.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.40. Helm 获取钩子

1.40.1. helm get hooks

下载命名版本的所有钩子

1.40.2. 简介

该命令下载指定版本的钩子

钩子被格式化为YAML格式并以YAML的’—\n’分隔符分隔

1
helm get hooks RELEASE_NAME [flags]

1.40.3. 可选项

1
2
-h, --help           help for hooks
--revision int get the named release with revision

1.40.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.41. Helm 补全

1.41.1. helm completion

为指定的shell生成自动补全脚本

1.41.2. 简介

为Helm生成针对于指定shell的自动补全脚本

1.41.3. 可选项

1
-h, --help   help for completion

1.41.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.42. Helm 验证

1.42.1. helm lint

验证chart是否存在问题

1.42.2. 简介

该命令使用一个chart路径并运行一系列的测试来验证chart的格式是否正确。

如果遇到引起chart安装失败的情况,会触发[ERROR]信息,如果遇到违反惯例或建议的问题,会触发[WARNING]。

1
helm lint PATH [flags]

1.42.3. 可选项

1
2
3
4
5
6
7
-h, --help                     help for lint
--set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--strict fail on lint warnings
-f, --values strings specify values in a YAML file or a URL (can specify multiple)
--with-subcharts lint dependent charts

1.42.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.43. Helm 验证

1.43.1. helm verify

验证给定路径的chart已经被签名且有效

1.43.2. 简介

验证指定的chart有合法的源文件。

源文件提供了加密验证保证chart未被篡改,且由可信提供商打包。

该命令用于验证本地chart,其他一些命令提供’–verify’参数执行同样的验证。要生成一个签名包,使用’helm package –sign’命令。

1
helm verify PATH [flags]

1.43.3. 可选项

1
2
-h, --help             help for verify
--keyring string keyring containing public keys (default "~/.gnupg/pubring.gpg")

1.43.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.44. Helm依赖升级

1.44.1. helm dependency update

基于Chart.yaml内容升级charts/

1.44.2. 简介

更新磁盘上的依赖为Chart.yaml指定内容。

该命令验证存储在’charts/‘目录中的’Chart.yaml’文件描述的所需chart以及所需版本。 它会拉取满足依赖的最新chart并清理旧依赖。

成功更新后,会生成一个锁定文件用来重新构建精确版本的依赖。

不需要在’Chart.yaml’中表示依赖。 因此,更新命令不会删除chart,除非是在Chart.yaml文件中的错误版本。

1
helm dependency update CHART [flags]

1.44.3. 可选项

1
2
3
4
-h, --help             help for update
--keyring string keyring containing public keys (default "~/.gnupg/pubring.gpg")
--skip-refresh do not refresh the local repository cache
--verify verify the packages against signatures

1.44.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.45. Helm依赖构建

1.45.1. helm dependency build

基于Chart.lock文件重新构建charts/目录

1.45.2. 简介

从Chart.lock构建输出到charts/目录

该构建是用来将chart的依赖项重建为锁定文件中的指定状态。就像’helm dependency update’一样并不会调整依赖状态。

如果没找到锁定文件,’helm dependency build’映射到’helm dependency update’

1
helm dependency build CHART [flags]

1.45.3. 可选项

1
2
3
4
-h, --help             help for build
--keyring string keyring containing public keys (default "~/.gnupg/pubring.gpg")
--skip-refresh do not refresh the local repository cache
--verify verify the packages against signatures

1.45.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.46. Helm创建

1.46.1. helm create

使用给定名称创建新的chart

1.46.2. 简介

该命令创建chart目录和chart用到的公共文件目录

比如’helm create foo’会创建一个目录结构看起来像这样:

1
2
3
4
5
6
7
foo/
├── .helmignore # Contains patterns to ignore when packaging Helm charts.
├── Chart.yaml # Information about your chart
├── values.yaml # The default values for your templates
├── charts/ # Charts that this chart depends on
└── templates/ # The template files
└── tests/ # The test files

‘helm create’使用一个目录作为参数。如果给定目录路径不存在,Helm会自动创建。如果给定目录存在且非空,冲突文件会被覆盖,其他文件会被保留。

1
helm create NAME [flags]

1.46.3. 可选项

1
2
-h, --help             help for create
-p, --starter string the name or absolute path to Helm starter scaffold

1.46.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.47. Helm获取Values

1.47.1. helm get values

下载命名版本的values文件

1.47.2. 简介

该命令下载给定版本的values文件

1
helm get values RELEASE_NAME [flags]

1.47.3. 可选项

1
2
3
4
-a, --all             dump all (computed) values
-h, --help help for values
-o, --output format prints the output in the specified format. Allowed values: table, json, yaml (default table)
--revision int get the named release with revision

1.47.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.48. Helm补全 - bash

1.48.1. helm completion bash

为bash生成自动补全脚本

1.48.2. 简介

为Helm生成针对于bash shell的自动补全脚本。

在当前shell会话中加载自动补全:

1
source <(helm completion bash)

为每个新的会话加载自动补全,执行一次:

  • Linux:

    1
    helm completion bash > /etc/bash_completion.d/helm
  • MacOS:

    1
    helm completion bash > /usr/local/etc/bash_completion.d/helm
1
helm completion bash

1.48.3. 可选项

1
-h, --help   help for bash

1.48.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
13
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.49. Helm补全 - fish

1.49.1. helm completion fish

为fish生成自动补全脚本

1.49.2. 简介

为Helm生成针对于fish shell的自动补全脚本。

在当前shell会话中加载自动补全:

1
helm completion fish | source

为每个新的会话加载自动补全,执行一次:

1
helm completion fish > ~/.config/fish/completions/helm.fish

您需要启动一个新的shell使其生效

1
helm completion fish [flags]

1.49.3. 可选项

1
2
-h, --help              help for fish
--no-descriptions disable completion descriptions

1.49.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
12
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

1.50. Helm补全 - zsh

1.50.1. helm completion zsh

为zsh生成自动补全脚本

1.50.2. 简介

为Helm生成针对于zsh shell的自动补全脚本。

在当前shell会话中加载自动补全:

1
source <(helm completion zsh)

为每个新的会话加载自动补全,执行一次:

1
2
helm completion zsh > "${fpath[1]}/_helm"
helm completion zsh [flags]

1.50.3. 可选项

1
2
-h, --help   help for zsh
--no-descriptions disable completion descriptions

1.50.4. 从父命令继承的命令

1
2
3
4
5
6
7
8
9
10
11
    --debug                       enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "~/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "~/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")
-------------本文结束感谢您的阅读-------------