helm-release-management

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Helm Release Management

Helm版本管理

Comprehensive guidance for day-to-day Helm release operations including installation, upgrades, uninstallation, and release tracking.
日常Helm版本操作的全面指南,包括安装、升级、卸载和版本跟踪。

When to Use

适用场景

Use this skill automatically when:
  • User requests deploying or installing Helm charts
  • User mentions upgrading or updating Helm releases
  • User wants to list or manage releases across namespaces
  • User needs to check release history or status
  • User requests uninstalling or removing releases
当出现以下情况时自动使用本技能:
  • 用户请求部署或安装Helm Charts
  • 用户提及升级Helm版本
  • 用户想要列出或管理跨命名空间的版本
  • 用户需要查看版本历史或状态
  • 用户请求卸载或移除版本

Core Release Operations

核心版本操作

Install New Release

安装新版本

bash
undefined
bash
undefined

Basic install

Basic install

helm install <release-name> <chart> --namespace <namespace> --create-namespace
helm install <release-name> <chart> --namespace <namespace> --create-namespace

Install with custom values

Install with custom values

helm install myapp bitnami/nginx
--namespace production
--create-namespace
--values values.yaml
--set replicaCount=3
helm install myapp bitnami/nginx
--namespace production
--create-namespace
--values values.yaml
--set replicaCount=3

Install with atomic rollback on failure

Install with atomic rollback on failure

helm install myapp ./mychart
--namespace staging
--atomic
--timeout 5m
--wait
helm install myapp ./mychart
--namespace staging
--atomic
--timeout 5m
--wait

Install from repository with specific version

Install from repository with specific version

helm install mydb bitnami/postgresql
--namespace database
--version 12.1.9
--values db-values.yaml
helm install mydb bitnami/postgresql
--namespace database
--version 12.1.9
--values db-values.yaml

Dry-run before actual install

Dry-run before actual install

helm install myapp ./chart
--namespace prod
--dry-run
--debug

**Key Flags:**
- `--namespace` - Target namespace (ALWAYS specify explicitly)
- `--create-namespace` - Create namespace if it doesn't exist
- `--values` / `-f` - Specify values file(s)
- `--set` - Override individual values
- `--atomic` - Rollback automatically on failure (RECOMMENDED)
- `--wait` - Wait for resources to be ready
- `--timeout` - Maximum time to wait (default 5m)
- `--dry-run --debug` - Preview without installing
helm install myapp ./chart
--namespace prod
--dry-run
--debug

**关键参数:**
- `--namespace` - 目标命名空间(务必明确指定)
- `--create-namespace` - 若命名空间不存在则创建
- `--values` / `-f` - 指定配置值文件
- `--set` - 覆盖单个配置值
- `--atomic` - 安装失败时自动回滚(推荐使用)
- `--wait` - 等待资源就绪
- `--timeout` - 最长等待时间(默认5分钟)
- `--dry-run --debug` - 预演安装过程,不实际执行

Upgrade Existing Release

升级现有版本

bash
undefined
bash
undefined

Basic upgrade with new values

Basic upgrade with new values

helm upgrade myapp ./mychart
--namespace production
--values values.yaml
helm upgrade myapp ./mychart
--namespace production
--values values.yaml

Upgrade with value overrides

Upgrade with value overrides

helm upgrade myapp bitnami/nginx
--namespace prod
--reuse-values
--set image.tag=1.21.0
helm upgrade myapp bitnami/nginx
--namespace prod
--reuse-values
--set image.tag=1.21.0

Upgrade with new chart version

Upgrade with new chart version

helm upgrade mydb bitnami/postgresql
--namespace database
--version 12.2.0
--atomic
--wait
helm upgrade mydb bitnami/postgresql
--namespace database
--version 12.2.0
--atomic
--wait

Install if not exists, upgrade if exists

Install if not exists, upgrade if exists

helm upgrade --install myapp ./chart
--namespace staging
--create-namespace
--values values.yaml
helm upgrade --install myapp ./chart
--namespace staging
--create-namespace
--values values.yaml

Force upgrade (recreate resources)

Force upgrade (recreate resources)

helm upgrade myapp ./chart
--namespace prod
--force
--recreate-pods

**Key Flags:**
- `--reuse-values` - Reuse existing values, merge with new
- `--reset-values` - Reset to chart defaults, ignore existing
- `--install` - Install if release doesn't exist
- `--force` - Force resource updates (use cautiously)
- `--recreate-pods` - Recreate pods even if no changes
- `--cleanup-on-fail` - Delete new resources on failed upgrade

**Value Override Precedence** (lowest to highest):
1. Chart default values (`values.yaml` in chart)
2. Previous release values (with `--reuse-values`)
3. Parent chart values
4. User-specified values files (`-f values.yaml`)
5. Individual value overrides (`--set key=value`)
helm upgrade myapp ./chart
--namespace prod
--force
--recreate-pods

**关键参数:**
- `--reuse-values` - 复用现有配置值,与新值合并
- `--reset-values` - 重置为Chart默认值,忽略现有配置
- `--install` - 若版本不存在则安装
- `--force` - 强制更新资源(谨慎使用)
- `--recreate-pods` - 即使无变更也重新创建Pod
- `--cleanup-on-fail` - 升级失败时删除新增资源

**配置值覆盖优先级**(从低到高):
1. Chart默认配置值(Chart中的`values.yaml`)
2. 历史版本配置值(使用`--reuse-values`时)
3. 父Chart配置值
4. 用户指定的配置值文件(`-f values.yaml`)
5. 单个配置值覆盖(`--set key=value`)

Uninstall Release

卸载版本

bash
undefined
bash
undefined

Basic uninstall

Basic uninstall

helm uninstall myapp --namespace production
helm uninstall myapp --namespace production

Uninstall but keep history (allows rollback)

Uninstall but keep history (allows rollback)

helm uninstall myapp
--namespace staging
--keep-history
helm uninstall myapp
--namespace staging
--keep-history

Uninstall with timeout

Uninstall with timeout

helm uninstall myapp
--namespace prod
--timeout 10m
--wait
undefined
helm uninstall myapp
--namespace prod
--timeout 10m
--wait
undefined

List Releases

列出版本

bash
undefined
bash
undefined

List releases in namespace

List releases in namespace

helm list --namespace production
helm list --namespace production

List all releases across all namespaces

List all releases across all namespaces

helm list --all-namespaces
helm list --all-namespaces

List with additional details

List with additional details

helm list
--all-namespaces
--output yaml
--max 50
helm list
--all-namespaces
--output yaml
--max 50

List including uninstalled releases

List including uninstalled releases

helm list --namespace staging --uninstalled
helm list --namespace staging --uninstalled

Filter releases by name pattern

Filter releases by name pattern

helm list --filter '^my.*' --namespace prod

**Key Flags:**
- `--all-namespaces` / `-A` - List releases across all namespaces
- `--all` - Show all releases including failed
- `--uninstalled` - Show uninstalled releases
- `--failed` - Show only failed releases
- `--pending` - Show pending releases
- `--filter` - Filter by release name (regex)
helm list --filter '^my.*' --namespace prod

**关键参数:**
- `--all-namespaces` / `-A` - 列出所有命名空间下的版本
- `--all` - 显示所有版本,包括失败的版本
- `--uninstalled` - 显示已卸载的版本
- `--failed` - 仅显示失败的版本
- `--pending` - 显示待处理的版本
- `--filter` - 按版本名称过滤(支持正则表达式)

Release Information & History

版本信息与历史

Check Release Status

查看版本状态

bash
undefined
bash
undefined

Get release status

Get release status

helm status myapp --namespace production
helm status myapp --namespace production

Show deployed resources

Show deployed resources

helm status myapp
--namespace prod
--show-resources
undefined
helm status myapp
--namespace prod
--show-resources
undefined

View Release History

查看版本历史

bash
undefined
bash
undefined

View revision history

View revision history

helm history myapp --namespace production
helm history myapp --namespace production

View detailed history

View detailed history

helm history myapp
--namespace prod
--output yaml
--max 10
undefined
helm history myapp
--namespace prod
--output yaml
--max 10
undefined

Inspect Release

检查版本详情

bash
undefined
bash
undefined

Get deployed manifest

Get deployed manifest

helm get manifest myapp --namespace production
helm get manifest myapp --namespace production

Get deployed values

Get deployed values

helm get values myapp --namespace production
helm get values myapp --namespace production

Get all values (including defaults)

Get all values (including defaults)

helm get values myapp --namespace prod --all
helm get values myapp --namespace prod --all

Get release metadata

Get release metadata

helm get metadata myapp --namespace production
helm get metadata myapp --namespace production

Get release notes

Get release notes

helm get notes myapp --namespace production
helm get notes myapp --namespace production

Get everything

Get everything

helm get all myapp --namespace production

For common workflows (deploy new application, update configuration, upgrade chart version, multi-environment deployment), best practices, troubleshooting, and integration with other tools, see [REFERENCE.md](REFERENCE.md).
helm get all myapp --namespace production

有关常见工作流(部署新应用、更新配置、升级Chart版本、多环境部署)、最佳实践、故障排查以及与其他工具的集成,请查看[REFERENCE.md](REFERENCE.md)。

Agentic Optimizations

智能优化建议

ContextCommand
List releases (structured)
helm list -n <ns> -o json
Release history (structured)
helm history <release> -n <ns> --output json
Release status (structured)
helm status <release> -n <ns> -o json
Values (structured)
helm get values <release> -n <ns> -o json
Failed releases
helm list -n <ns> --failed -o json
场景命令
结构化列出版本
helm list -n <ns> -o json
结构化版本历史
helm history <release> -n <ns> --output json
结构化版本状态
helm status <release> -n <ns> -o json
结构化配置值
helm get values <release> -n <ns> -o json
失败版本列表
helm list -n <ns> --failed -o json

Related Skills

相关技能

  • Helm Debugging - Troubleshooting failed deployments
  • Helm Values Management - Advanced values configuration
  • Helm Release Recovery - Rollback and recovery strategies
  • ArgoCD CLI Login - GitOps integration with ArgoCD
  • Kubernetes Operations - Managing deployed resources
  • Helm调试 - 排查部署失败问题
  • Helm配置值管理 - 高级配置值管理
  • Helm版本恢复 - 回滚与恢复策略
  • ArgoCD CLI登录 - 与ArgoCD集成实现GitOps
  • Kubernetes操作 - 管理已部署的资源

References

参考资料