Configs2026年4月11日·1 分钟阅读

Helm — The Package Manager for Kubernetes

Helm is the package manager for Kubernetes. Helps you manage Kubernetes applications via Helm Charts, which define, install, and upgrade even the most complex Kubernetes apps. The de facto way to distribute production-grade K8s software.

AI
AI Open Source · Community
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。

# Install
brew install helm                          # macOS
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

Add a repo and install a chart:

helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update

# Search
helm search repo redis

# Install
helm install my-redis bitnami/redis

# Upgrade
helm upgrade my-redis bitnami/redis --set auth.password=secret

# Rollback
helm rollback my-redis 1

# Uninstall
helm uninstall my-redis

Create your own chart:

helm create mychart
helm lint mychart
helm template mychart                      # Render YAML locally
helm install my-release ./mychart
helm package mychart                       # Produce .tgz
介绍

Helm is the package manager for Kubernetes. It helps you manage Kubernetes applications through Helm Charts, which are templated YAML files that describe a related set of Kubernetes resources. Helm 3 removed Tiller (server-side component) making it simpler and more secure.

What Helm Does

  • Charts — packaged templated Kubernetes manifests
  • Values — override defaults per install
  • Templates — Go template language for dynamic resources
  • Releases — named install instances of a chart
  • Rollbacks — revert to a previous release
  • Dependencies — charts can depend on other charts
  • Hooks — pre-install, post-upgrade lifecycle
  • Repositories — share and discover charts
  • OCI registry — store charts in OCI-compliant registries

Architecture

Helm 3 is a pure client-side tool (no Tiller). helm install renders the templates locally, applies manifests to the cluster via the Kubernetes API, and stores release metadata as Kubernetes Secrets. No server-side component with cluster-admin rights.

Self-Hosting

CLI tool — runs on developer workstation or CI. Charts can be hosted anywhere:

  • ChartMuseum — open-source chart repo
  • Harbor — container registry with Helm chart support
  • GitHub Pages — via helm repo index
  • Any OCI registry — Docker Hub, GHCR, ECR

Key Features

  • Templated manifests
  • Release tracking
  • Rollback support
  • Chart dependencies
  • Lifecycle hooks
  • Values hierarchy (CLI > values file > defaults)
  • Chart testing (helm test)
  • OCI registry support
  • Public chart hubs (Artifact Hub)

Comparison

Tool Approach Templating Rollbacks
Helm Template + release Go templates Yes
Kustomize Overlay + base No templates Manual
Jsonnet Programmable JSON Jsonnet Manual
Pulumi Programming lang Any language Via state
Cdk8s TypeScript/Python Code Via state

常见问题 FAQ

Q: Helm vs Kustomize? A: Helm 适合分发通用软件(values 覆盖定制);Kustomize 适合环境差异(dev/stage/prod overlay)。常组合使用:Helm 给默认值,Kustomize 做 environment-specific patch。

Q: 模板太复杂? A: Go template 确实有学习曲线。复杂逻辑可以用 Helm 3 支持的 Lua-like 扩展,或切到 Cue/Pulumi/Jsonnet。

Q: v2 vs v3? A: v3 移除了 Tiller(server 组件),安全性和简洁性大幅提升。v2 已 EOL,新项目必须 v3。

来源与致谢 Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产