helm常用命令
helm常用命令
helm repo update # 确定我们可以拿到最新的charts列表
helm show chart bitnami/mysql # 命令简单的了解到这个chart的基本信息
helm show all bitnami/mysql # 获取关于该chart的所有信息。
helm list # (或 helm ls) 命令会列出所有可被部署的版本。
helm uninstall # 命令卸载你的版本,它将删除和该版本相关的所有相关资源(service、deployment、 pod等等)甚至版本历史。
# helm uninstall 的时候提供 --keep-history 选项, Helm将会保存版本历史。 您可以通过命令查看该版本的信息 helm status mysql-1612624192
# --keep-history 选项会让helm跟踪你的版本(即使你卸载了他们), 所以你可以审计集群历史甚至使用 helm rollback 回滚版本。
helm help # 查看更多的有用的信息,或者在任意命令后添加 -h 选项:helm get -h
# Release 是运行在 Kubernetes 集群中的 chart 的实例。一个 chart 通常可以在同一个集群中安装多次。每一次安装都会创建一个新的 release。以 MySQL chart为例,如果你想在你的集群中运行两个数据库,你可以安装该chart两次。每一个数据库都会拥有它自己的 release 和 release name。
# Helm 安装 charts 到 Kubernetes 集群中,每次安装都会创建一个新的 release。你可以在 Helm 的 chart repositories 中寻找新的 chart。
helm search hub # 如果不进行过滤,会展示所有可用的 charts, 从 Artifact Hub 中查找并列出 helm charts。 Artifact Hub中存放了大量不同的仓库。
helm search repo # 从你添加(使用 helm repo add)到本地 helm 客户端中的仓库中进行查找。该命令基于本地数据进行搜索,无需连接互联网。
helm search hub # 找到公开可用的charts:helm search hub wordpress
helm search repo # 你可以从你所添加的仓库中查找chart的名字
helm repo add brigade https://brigadecore.github.io/charts
helm search repo brigade # Helm 搜索使用模糊字符串匹配算法,所以你可以只输入名字的一部分
helm status # 来追踪 release 的状态,或是重新读取配置信息
helm show values # 可以查看 chart 中的可配置选项,例如 helm show values bitnami/wordpress
helm upgrade # 更新自上次发布以来发生了更改的内容
helm get values # 命令来看看配置值是否真的生效,helm get values happy-panda
helm rollback [RELEASE] [REVISION] # 命令回滚到之前的发布版本。helm rollback happy-panda 1
helm create # 开发你自己的chart,helm create deis-workflow
helm lint # 验证格式是否正确。
helm package # 准备将 chart 打包分发
Chart 管理
helm create <name> # Creates a chart directory along with the common files and directories used in a chart.
helm package <chart-path> # Packages a chart into a versioned chart archive file.
helm lint <chart> # Run tests to examine a chart and identify possible issues:
helm show all <chart> # Inspect a chart and list its contents:
helm show values <chart> # Displays the contents of the values.yaml file
helm pull <chart> # Download/pull chart
helm pull <chart> --untar=true # If set to true, will untar the chart after downloading it
helm pull <chart> --verify # Verify the package before using it
helm pull <chart> --version <number> # Default-latest is used, specify a version constraint for the chart version to use
helm dependency list <chart> # Display a list of a chart’s dependencies:
安装和卸载应用
helm install <name> <chart> # Install the chart with a name
helm install <name> <chart> --namespace <namespace> # Install the chart in a specific namespace
helm install <name> <chart> --set key1=val1,key2=val2 # Set values on the command line (can specify multiple or separate values with commas)
helm install <name> <chart> --values <yaml-file/url> # Install the chart with your specified values
helm install <name> <chart> --dry-run --debug # Run a test installation to validate chart (p)
helm install <name> <chart> --verify # Verify the package before using it
helm install <name> <chart> --dependency-update # update dependencies if they are missing before installing the chart
helm uninstall <name> # Uninstall a release
应用升级和回滚
helm upgrade <release> <chart> # Upgrade a release
helm upgrade <release> <chart> --atomic # If set, upgrade process rolls back changes made in case of failed upgrade.
helm upgrade <release> <chart> --dependency-update # update dependencies if they are missing before installing the chart
helm upgrade <release> <chart> --version <version_number> # specify a version constraint for the chart version to use
helm upgrade <release> <chart> --values # specify values in a YAML file or a URL (can specify multiple)
helm upgrade <release> <chart> --set key1=val1,key2=val2 # Set values on the command line (can specify multiple or separate valuese)
helm upgrade <release> <chart> --force # Force resource updates through a replacement strategy
helm rollback <release> <revision> # Roll back a release to a specific revision
helm rollback <release> <revision> --cleanup-on-fail # Allow deletion of new resources created in this rollback when rollback fails
列出,添加,移除和升级仓库
helm repo add <repo-name> <url> # Add a repository from the internet:
helm repo list # List added chart repositories
helm repo update # Update information of available charts locally from chart repositories
helm repo remove <repo_name> # Remove one or more chart repositories
helm repo index <DIR> # Read the current directory and generate an index file based on the charts found.
helm repo index <DIR> --merge # Merge the generated index with an existing index file
helm search repo <keyword> # Search repositories for a keyword in charts
helm search hub <keyword> # Search for charts in the Artifact Hub or your own hub instance
Helm 发布检测
helm list # Lists all of the releases for a specified namespace, uses current namespace context if namespace not specified
helm list --all # Show all releases without any filter applied, can use -a
helm list --all-namespaces # List releases across all namespaces, we can use -A
helm -l key1=value1,key2=value2 # Selector (label query) to filter on, supports '=', '==', and '!='
helm list --date # Sort by release date
helm list --deployed # Show deployed releases. If no other is specified, this will be automatically enabled
helm list --pending # Show pending releases
helm list --failed # Show failed releases
helm list --uninstalled # Show uninstalled releases (if 'helm uninstall --keep-history' was used)
helm list --superseded # Show superseded releases
helm list -o yaml # Prints the output in the specified format. Allowed values: table, json, yaml (default table)
helm status <release> # This command shows the status of a named release.
helm status <release> --revision <number> # if set, display the status of the named release with revision
helm history <release> # Historical revisions for a given release.
helm env # Env prints out all the environment information in use by Helm.
下载发布信息
helm get all <release> # A human readable collection of information about the notes, hooks, supplied values, and generated manifest file of the given release.
helm get hooks <release> # This command downloads hooks for a given release. Hooks are formatted in YAML and separated by the YAML '---\n' separator.
helm get manifest <release> # A manifest is a YAML-encoded representation of the Kubernetes resources that were generated from this release's chart(s). If a chart is dependent on other charts, those resources will also be included in the manifest.
helm get notes <release> # Shows notes provided by the chart of a named release.
helm get values <release> # Downloads a values file for a given release. use -o to format output
插件管理
helm plugin install <path/url1> # Install plugins
helm plugin list # View a list of all installed plugins
helm plugin update <plugin> # Update plugins
helm plugin uninstall <plugin> # Uninstall a plugin
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通