您的位置:首页 > 游戏 > 游戏 > 第 3 篇 Helm 命令、环境变量、相关目录

第 3 篇 Helm 命令、环境变量、相关目录

2024/11/18 16:10:23 来源:https://blog.csdn.net/u012383839/article/details/142031360  浏览:    关键词:第 3 篇 Helm 命令、环境变量、相关目录

文章目录

  • Helm 命令
  • Helm 环境变量
  • Helm 相关目录
  • 相关博文

🚀 本文内容:

  • 介绍 Helm 命令及选项
  • 介绍 Helm 相关环境变量
  • 介绍 Helm 相关目录

Helm 命令

直接输入 helm help即可查看 helm 命令 的详细使用信息。

The Kubernetes package managerCommon 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 chartsEnvironment 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_DEBUG                        | indicate whether or not Helm is running in Debug mode                             |
| $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_MAX_HISTORY                  | set the maximum number of helm release history.                                   |
| $HELM_NAMESPACE                    | set the namespace used for the helm operations.                                   |
| $HELM_NO_PLUGINS                   | disable plugins. Set HELM_NO_PLUGINS=1 to disable plugins.                        |
| $HELM_PLUGINS                      | set the path to the plugins directory                                             |
| $HELM_REGISTRY_CONFIG              | set the path to the registry config file.                                         |
| $HELM_REPOSITORY_CACHE             | set the path to the repository cache directory                                    |
| $HELM_REPOSITORY_CONFIG            | set the path to the repositories file.                                            |
| $KUBECONFIG                        | set an alternative Kubernetes configuration file (default "~/.kube/config")       |
| $HELM_KUBEAPISERVER                | set the Kubernetes API Server Endpoint for authentication                         |
| $HELM_KUBECAFILE                   | set the Kubernetes certificate authority file.                                    |
| $HELM_KUBEASGROUPS                 | set the Groups to use for impersonation using a comma-separated list.             |
| $HELM_KUBEASUSER                   | set the Username to impersonate for the operation.                                |
| $HELM_KUBECONTEXT                  | set the name of the kubeconfig context.                                           |
| $HELM_KUBETOKEN                    | set the Bearer KubeToken used for authentication.                                 |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 systemBy 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 autocompletion scripts for the specified shellcreate      create a new chart with the given namedependency  manage a chart's dependenciesenv         helm client environment informationget         download extended information of a named releasehelp        Help about any commandhistory     fetch release historyinstall     install a chartlint        examine a chart for possible issueslist        list releasespackage     package a chart directory into a chart archiveplugin      install, list, or uninstall Helm pluginspull        download a chart from a repository and (optionally) unpack it in local directoryrepo        add, list, remove, update, and index chart repositoriesrollback    roll back a release to a previous revisionsearch      search for a keyword in chartsshow        show information of a chartstatus      display the status of the named releasetemplate    locally render templatestest        run tests for a releaseuninstall   uninstall a releaseupgrade     upgrade a releaseverify      verify that a chart at the given path has been signed and is validversion     print the client version informationFlags:--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 "/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")Use "helm [command] --help" for more information about a command.

语法:helm [command]

commandcommand 说明
常用命令
repo仓库管理,添加、列出、删除、更新和索引 chart 仓库
search搜索 chart
pull下载 chart 并解压到本地目录
show查看 chart 信息
install安装 chart
upgrade升级 chart
test运行测试,针对特定的发布
status查看 chart 状态
list列出已安装的 chart
history查看指定发布的历史
rollback回滚到历史版本
get下载指定发布的扩展信息(all、hooks、manifest、notes、values)
uninstall卸载 chart
自定义 chart 相关
create使用给定的名称创建 chart
dependency管理 chart 依赖,build、list、update
template本地渲染模板,针对 chart,显示出按 release 名称的模板文件
lint验证 chart 是否存在问题
package将 chart 目录打包(并签名)
verify验证 chart 是否签名且有效
辅助命令
env查看 HELM 环境变量
plugin插件相关,install、list、uninstall
completion为指定的 shell(比如 bash、fish、zsh)生成自动补全脚本
version打印客户端版本信息
help帮助命令

还有一些 Flag 参数:

    --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 "/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")

Helm 环境变量

helm 使用的环境变量如下:

环境变量描述
$HELM_CACHE_HOMEHelm 缓存目录
$HELM_CONFIG_HOMEHelm 配置目录
$HELM_DATA_HOMEHelm 数据目录
$HELM_DEBUG是否开启 DEBUG 模式
$HELM_DRIVER设置后台存储驱动,可选值:configmap、secret、memory、sql
$HELM_DRIVER_SQL_CONNECTION_STRINGSQL 存储驱动连接字符串
$HELM_MAX_HISTORY设置 Helm 发布历史记录最大值
$HELM_NAMESPACEHelm 操作时使用的 namespace
$HELM_NO_PLUGINS禁用插件,HELM_NO_PLUGINS=1 表示禁用插件
$HELM_PLUGINS插件目录路径
$HELM_REGISTRY_CONFIGregistry 配置文件路径
$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
$HELM_KUBEINSECURE_SKIP_TLS_VERIFY设置 Kubernetes API 服务的证书验证是否跳过(不安全)
$HELM_KUBETLS_SERVER_NAME设置用于验证 Kubernetes API 服务器证书的服务器名称
$HELM_BURST_LIMIT设置当 kubernetes 服务包含很大量 CRD 时的默认上限值(默认 100, -1 是不可用)

Helm 相关目录

helm 缓存、配置和数据 放在哪里?基于如下配置顺序:

  • 如果设置了 HELM_*_HOME,则使用这个。比如 HELM_CACHE_HOME、HELM_CONFIG_HOME、HELM_DATA_HOME。
  • 否则,在支持 XDG 基本目录规范的系统上,将使用 XDG 变量
  • 最后,使用基于操作系统的默认位置。具体如下表所示:
OSCache PathConfiguration PathData 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

相关博文

1.第 1 篇 Helm 简介及安装
2.第 2 篇 Helm 部署 MySQL【入门案例】
3.第 3 篇 Helm 命令、环境变量、相关目录
4.第 4 篇 Chart 仓库详解
5.第 5 篇 Chart 文件结构详解
6.第 6 篇 自定义 Helm Chart
7.第 7 篇 Helm 部署 Nacos【详细步骤】
8.第 8 篇 Chart 修改入门示例:Nacos
9.第 9 篇 Helm 部署 Seata Server
10.第 10 篇 Chart 修改完美示例:Seata Server
11.第 11篇 Helm 部署 RabbitMQ
12.第 12 篇 Helm 部署 Redis
13.第13 篇 Helm 部署 ElasticSearch

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com