1. helm3 安装

Helm2 依赖 Tiller,而 Helm3 已经移除了 Tiller 的依赖,只需安装一个客户端即可。

Helm 客户端可以从源代码安装,也可以从预构建的二进制版本安装。一般情况下如无必要,推荐使用二进制的方式安装使用。

1.1. 通过二进制版本安装

每一个版本的 Helm 提供多种操作系统的二进制版本,支持选择 LinuxMac OSWindows平台,以及amd64armi386ppc64les390x的CPU类型。

这些二进制版本可以手动下载和安装。下载地址:https://github.com/helm/helm/releases

选择需要的版本进行下,例如 Linux amd64 版的下载地址 https://get.helm.sh/helm-v3.3.0-rc.1-linux-amd64.tar.gz

wget https://get.helm.sh/helm-v3.3.0-rc.1-linux-amd64.tar.gz
tar xf helm-v3.3.0-rc.1-linux-amd64.tar.gz
cp linux-amd64/helm /usr/local/bin/helm
chmod +x /usr/local/bin/helm

1.2. 通过脚本安装

Helm 官方提供一套 shell 的安装脚本,将自动获取最新版本的 Helm 客户端并在本地安装。

可以获取该脚本,然后在本地执行它。使用脚本安装默认都是按照最新版本的 Helm 。

curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash

1.3. 通过源代码安装

从源代码构建 Helm 的工作相对复杂一些,但如果测试最新的(预发布)Helm 版本,从源代码构建是最好的方法。

你必须有一个安装 Go 工作环境

$ cd PATH/TO/Go
$ mkdir -p src/k8s.io
$ cd src/k8s.io
$ git clone https://github.com/helm.git
$ cd helm
$ make bootstrap build

该 bootstrap 目标将尝试安装依赖,重建 vendor / 树,并验证配置。

该 build 目标编译 helm 并将其放置在 bin/helm 目录。

1.4. 通过软件源安装

  • 通过 Snap (Linux) Snap package 维护站点 Snapcrafters.
$ sudo snap install helm --classic
  • 通过 homebrew(macOS) Kubernetes 社区的成员为 Homebrew 贡献了 Helm。这个通常是最新的。
brew install kubernetes-helm

注意:emacs-helm 也是一个软件,这是一个不同的项目。

  • 从 Chocolatey 或 scoop (Windows) Kubernetes 社区的成员为 Chocolatey 贡献了 Helm 包。这个软件包通常是最新的。
choco install kubernetes-helm

也可以通过 scoop 命令行安装.

scoop install helm

1.5. 安装完成后验证

  • 查看 helm 的版本信息

    $ helm version
    version.BuildInfo{Version:"v3.3.0-rc.1", GitCommit:"5c2dfaad847df2ac8f289d278186d048f446c70c", GitTreeState:"dirty", GoVersion:"go1.14.4"}
    • 查看kubernetes集群中已经通过 Chart 安装的 Release
    $ helm ls
    NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
    • 获取帮助信息 ``` $ helm help The Kubernetes package manager

Common actions for Helm:

  • helm search: search for charts
  • helm pull: download a chart to your local directory to view
  • helm install: upload the chart to Kubernetes
  • helm list: list releases of charts

Environment variables:

Name Description
$HELM_CACHE_HOME set an alternative location for storing cached files.
$HELM_CONFIG_HOME set an alternative location for storing Helm configuration.
$HELM_DATA_HOME set an alternative location for storing Helm data.
$HELM_DRIVER set the backend storage driver. Values are: configmap, secret, memory, postgres
$HELM_DRIVER_SQL_CONNECTION_STRING set the connection string the SQL storage driver should use.
$HELM_NO_PLUGINS disable plugins. Set HELM_NO_PLUGINS=1 to disable plugins.
$KUBECONFIG set an alternative Kubernetes configuration file (default "~/.kube/config")

Helm stores cache, configuration, and data based on the following configuration order:

  • If a HELM_*_HOME environment variable is set, it will be used
  • Otherwise, on systems supporting the XDG base directory specification, the XDG variables will be used
  • When no other location is set a default location will be used based on the operating system

By default, the default directories depend on the Operating System. The defaults are listed below:

Operating System Cache Path Configuration Path Data Path
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

Usage: helm [command]

Available Commands: completion generate autocompletions script for the specified shell 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 examine 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 display 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-apiserver string the address and the port for the Kubernetes API server --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 --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 "/root/.config/helm/registry.json") --repository-cache string path to the file containing cached repository indexes (default "/root/.cache/helm/repository") --repository-config string path to the file containing repository names and URLs (default "/root/.config/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

Use "helm [command] --help" for more information about a command. ```

Copyright © 温玉 2021 | 浙ICP备2020032454号 all right reserved,powered by Gitbook该文件修订时间: 2021-05-09 09:47:56

results matching ""

    No results matching ""