【Helm】-- 在 mac 上安装 helm cli

Source

目录

1.helm 介绍

2.在 mac 上安装 helm

2.1 下载 helm tar 包

2.2 解压 tar 包

2.3 移动文件到 bin 目录下

2.3 验证安装是否成功

3.helm 的命令行


1.helm 介绍

Helm 是一个 Kubernetes 包管理器,可以用于简化 Kubernetes 应用程序的部署和管理。Helm 可以将 Kubernetes 应用程序打包为 chart,然后将这些 chart 分享和分发给其他人。

Chart 是一组预定义的 Kubernetes 资源模板,可以通过 Helm 进行部署和管理。Helm 还提供了一些有用的命令行工具,例如 helm install、helm upgrade 和 helm rollback,可以帮助您轻松地部署和管理 Kubernetes 应用程序。

Helm 还支持使用 chart 之间的依赖关系,这使得可以将多个 chart 组合在一起以部署更复杂的应用程序。

2.在 mac 上安装 helm

2.1 下载 helm tar 包

有几种方式安装 helm,这里我选择了下载包安装。首先,需要在 Helm GitHub 存储库的 Releases 页面上找到要安装的版本的 tarball 文件的 URL。可以在以下链接中找到 Helm 存储库的 Releases 页面:Releases · helm/helm · GitHub

curl -LO https://get.helm.sh/helm-v3.1.0-darwin-amd64.tar.gz

2.2 解压 tar 包

tar -zxvf helm-v3.1.0-darwin-amd64.tar.gz 

2.3 移动文件到 bin 目录下

解压缩后,我们会得到一个名为 darwin-amd64 的目录,其中包含 Helm CLI 可执行文件。可以将该目录移动到 PATH 中,以便在终端中使用 Helm CLI。例如,可以使用以下命令将该目录移动到 /usr/local/bin 目录中:

sudo mv darwin-amd64/helm /usr/local/bin/helm

2.3 验证安装是否成功

可以使用以下命令来验证 Helm CLI 是否已成功安装:

helm version

如果一切正常,您应该能够看到 Helm CLI 的版本信息。

3.helm 的命令行

Usage:
  helm [command]

Available Commands:
  completion  Generate autocompletions script for the specified shell (bash or zsh)
  create      create a new chart with the given name
  dependency  manage a chart's dependencies
  env         Helm client environment information
  get         download extended information of a named release
  help        Help about any command
  history     fetch release history
  install     install a chart
  lint        examines a chart for possible issues
  list        list releases
  package     package a chart directory into a chart archive
  plugin      install, list, or uninstall Helm plugins
  pull        download a chart from a repository and (optionally) unpack it in local directory
  repo        add, list, remove, update, and index chart repositories
  rollback    roll back a release to a previous revision
  search      search for a keyword in charts
  show        show information of a chart
  status      displays the status of the named release
  template    locally render templates
  test        run tests for a release
  uninstall   uninstall 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 version information

Flags:
      --add-dir-header                   If true, adds the file directory to the header
      --alsologtostderr                  log to standard error as well as files
      --debug                            enable verbose output
  -h, --help                             help for helm
      --kube-context string              name of the kubeconfig context to use
      --kubeconfig string                path to the kubeconfig file
      --log-backtrace-at traceLocation   when logging hits line file:N, emit a stack trace (default :0)
      --log-dir string                   If non-empty, write log files in this directory
      --log-file string                  If non-empty, use this log file
      --log-file-max-size uint           Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
      --logtostderr                      log to standard error instead of files (default true)
  -n, --namespace string                 namespace scope for this request
      --registry-config string           path to the registry config file (default "/Users/yangjifei/Library/Preferences/helm/registry.json")
      --repository-cache string          path to the file containing cached repository indexes (default "/Users/yangjifei/Library/Caches/helm/repository")
      --repository-config string         path to the file containing repository names and URLs (default "/Users/yangjifei/Library/Preferences/helm/repositories.yaml")
      --skip-headers                     If true, avoid header prefixes in the log messages
      --skip-log-headers                 If true, avoid headers when opening log files
      --stderrthreshold severity         logs at or above this threshold go to stderr (default 2)
  -v, --v Level                          number for the log level verbosity
      --vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging

参考官方文档:Helm | Helm