Helm 2和Helm 3在使用上还是有些区别的,除了在Helm 3中移除了Tiller,一些常用的命令也发生了变化,在这篇文章中进行简单的整理。
常用命令一览
| 命令 | Helm 2 | Helm 3 | 命令说明区别 | 命令说明 |
|---|---|---|---|---|
| create | 有 | 有 | 无 | create a new chart with the given name |
| delete | 有 | 无 | - | given a release name, delete the release from Kubernetes |
| dependency | 有 | 有 | 无 | manage a chart’s dependencies |
| fetch | 有 | 无 | - | download a chart from a repository and (optionally) unpack it in local directory |
| get | 有 | 有 | 有 | download a named release |
| history | 有 | 有 | 无 | fetch release history |
| home | 有 | 无 | - | displays the location of HELM_HOME |
| init | 有 | 无 | - | initialize Helm on both client and server |
| inspect | 有 | 无 | - | inspect a chart |
| install | 有 | 有 | 有 | install a chart archive |
| lint | 有 | 有 | 无 | examines a chart for possible issues |
| list | 有 | 有 | 无 | list releases |
| package | 有 | 有 | 无 | package a chart directory into a chart archive |
| plugin | 有 | 有 | 有 | add, list, or remove Helm plugins |
| repo | 有 | 有 | 无 | add, list, remove, update, and index chart repositories |
| reset | 有 | 无 | - | uninstalls Tiller from a cluster |
| rollback | 有 | 有 | 无 | roll back a release to a previous revision |
| search | 有 | 有 | 无 | search for a keyword in charts |
| serve | 有 | 无 | - | start a local http web server |
| status | 有 | 有 | 无 | displays the status of the named release |
| template | 有 | 有 | 无 | locally render templates |
| test | 有 | 有 | 有 | test a release |
| upgrade | 有 | 有 | 无 | upgrade a release |
| verify | 有 | 有 | 无 | verify that a chart at the given path has been signed and is valid |
| version | 有 | 有 | 有 | print the client/server version information |
| env | 无 | 有 | - | Helm client environment information |
| help | 无 | 有 | - | Help about any command |
| pull | 无 | 有 | - | download a chart from a repository and (optionally) unpack it in local directory |
| show | 无 | 有 | - | show information of a chart |
| uninstall | 无 | 有 | - | uninstall a release |
Helm 3: 不再存在的Helm 2的命令
在前面的文章示例中,我们发现helm init已经在Helm 3中不存在了。类似的共有如下7条命令,在Helm 3中或删除或改名或则功能增强,比如因为Tiller的去除,所以导致了reset命令没有存在的意义,同时init存在仅剩客户端需要设定的功能,所以被去除了。另外诸如fetch命令,而在Helm 3中提供了pull命令予以替代。本来home命令用于显示HELM_HOME环境变量,而在Helm 3中提供env命令可以显示所有的环境变量信息,用增强的功能予以了替换。但是无论如何,总之已经无法在Helm 3中直接使用如下7条命令。
| 命令 | Helm 2 | Helm 3 | 命令说明 |
|---|---|---|---|
| delete | 有 | 无 | given a release name, delete the release from Kubernetes |
| fetch | 有 | 无 | download a chart from a repository and (optionally) unpack it in local directory |
| home | 有 | 无 | displays the location of HELM_HOME |
| init | 有 | 无 | initialize Helm on both client and server |
| inspect | 有 | 无 | inspect a chart |
| reset | 有 | 无 | uninstalls Tiller from a cluster |
| serve | 有 | 无 | start a local http web server |
Helm 3: 相较与Helm 2新增的命令
相较于Helm 2,从helm --help中获得的信息看到如下5条命令在Helm 3中为新增的命令。
| 命令 | Helm 2 | Helm 3 | 命令说明 |
|---|---|---|---|
| env | 无 | 有 | Helm client environment information |
| help | 无 | 有 | Help about any command |
| pull | 无 | 有 | download a chart from a repository and (optionally) unpack it in local directory |
| show | 无 | 有 | show information of a chart |
| uninstall | 无 | 有 | uninstall a release |
稍作分析,会发现如下事实:
- env是对被删除的命令home的强化
- pull是对被删除的命令fetch的替换
- show是对被删除的命令inspect的替换
- help命令本身在Helm 2时代就可以使用,只是helm --help里面没有显示,算是文档自包含的强化
- uninstall是功能特性的增强
Helm 3: 命令说明发生变化
由于Tiller的移除,版本显示命令helm version的表述从显示client/server的版本信息变成了显示client的版本信息,类似的发生变化的共有5条命令,到底是文档的变化还是功能性的反映,在后续的文章中将继续通过实例进行进一步的说明。
| 命令 | Helm 2 | Helm 3 | 命令说明区别 | Helm 2 命令说明 | Helm 3命令说明 |
|---|---|---|---|---|---|
| get | 有 | 有 | 有 | download a named release | download extended information of a named release |
| install | 有 | 有 | 有 | install a chart archive | install a chart |
| plugin | 有 | 有 | 有 | add, list, or remove Helm plugins | install, list, or uninstall Helm plugins |
| test | 有 | 有 | 有 | test a release | run tests for a release |
| version | 有 | 有 | 有 | print the client/server version information | print the client version information |
Helm 3: 其他变化
并不是说helm --help没有变化的,使用上就没有区别,以repo和install为例,在使用上都发生了变化,但是在helm自身提供的帮助信息中却未提供,这些也会在后续的示例的使用中进一步进行说明。
Helm 2 到Helm 3的升级
helm还提供了一个移植的插件,详细可参看:
- https://github.com/helm/helm-2to3
备注
本文用于对比的Helm 命令取之与Helm 2.8.2和Helm 3.0.0。
参考内容
https://github.com/helm/helm-2to3