CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

Helmfile

$ helmfile 社区开源 高风险
Helmfile · 云原生与基础设施 · MIT · macos / linux / windows

Helmfile(helmfile)通过声明式 helmfile.yaml 统一管理跨环境(-e)的多 Helm Chart 发布。结合 helmfile template 与 helmfile diff --output json 进行上线前安全预览,再通过 helmfile apply 或 sync 幂等发布。

FCRS-1.0 综合评分
80 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install helmfile
CLI vs MCP 选型建议 优先选 CLI

helmfile 在本地磁盘执行 helmfile.yaml Go 模板渲染、helm-diff 与多 Chart 编排,通用 MCP 工具无法完整替代。

Agent 友好度体检单

✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
✓ 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 19 / 25

支持 diff --output json、--no-color、默认非交互执行 apply(除非传 --interactive)及 -l 选择器,但依赖 helm 与 helm-diff。

  • helmfile diff --output json and --no-color support
  • Non-interactive by default unless --interactive is explicitly set
安全与权限边界 19 / 25

template 与 diff 提供完善的事前检查能力,但 apply/sync/destroy 会直接变更线上 Kubernetes 集群。

  • diff preview before apply; destroy deletes all matched releases
安装与运行摩擦 12 / 15

自身为 Go 单二进制,但运行 diff 与 apply 必须额外安装 helm 与 helm-diff 插件。

  • External dependency on helm binary and helm-diff plugin
能力覆盖与边际价值 14 / 15

用单一 helmfile.yaml 优雅解决多 Chart、多环境 Helm 编排问题。

  • Supports environment layering (-e), selectors (-l), and helmfile list --output json
维护与来源背书 8 / 10

社区活跃维护的 MIT 开源项目(helmfile/helmfile)。

  • MIT-licensed helmfile/helmfile repository
文档与可验证性 8 / 10

helmfile.readthedocs.io 手册与命令行参考齐全。

  • Published docs at helmfile.readthedocs.io

安全边界、鉴权与放权指南

鉴权方式
本地配置文件 环境变量密钥
凭证存储位置

复用 Kubernetes kubeconfig(~/.kube/config、KUBECONFIG)以及可选的 Helm 仓库/OCI 镜像库凭证。

潜在副作用
只读查询 本地写入 远端写入 破坏性删除
费用与配额提示

MIT 开源 CLI 免费;下发 Chart 会在目标 Kubernetes 集群中调度计算资源。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# Helmfile Agent Rules
- Always run `helmfile -e <env> template` or `helmfile -e <env> diff --output json` before `apply` or `sync`.
- Scope mutations with `-e <env>` and `-l <selector>` rather than running cluster-wide.
- Never run `helmfile destroy` without explicit user confirmation.

Agent 高频安全命令配方

只读查询(安全推荐)

本地渲染全部清单而不改动集群
helmfile -e staging template --skip-deps

将 helmfile.yaml 与关联 Chart 在本地展开为 YAML,供审阅或送入 kubeconform 校验。

以 JSON 格式对比线上发布差异
helmfile -e staging diff --output json --no-color

通过 helm-diff 计算发布差异并输出结构化 JSON,不执行变更。

受控写入与预演

按选择器定向应用单个 Release 变更
helmfile -e staging -l name=api apply --skip-diff-on-install

核对 diff 后使用 -l 将 apply 范围限制到指定 Release。

核心优势

  • + helmfile template 与 helmfile diff --output json 为 Agent 提供可靠的事前可见性。
  • + -e <env> 与 -l <selector> 支持精准限定操作范围。
  • + 默认非交互运行(apply 仅在传入 --interactive 时才提示确认)。

注意事项与踩坑点

  • ! 需要同时预装 helm 及 helm-diff 插件(helm plugin install ...)才能正常使用 diff 与 apply。
  • ! 复杂的 helmfile.yaml 模板可能触发外部 exec 钩子,处理不可信仓库时需留意。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI