Helmfile
$ helmfile 社区开源 高风险Helmfile(helmfile)通过声明式 helmfile.yaml 统一管理跨环境(-e)的多 Helm Chart 发布。结合 helmfile template 与 helmfile diff --output json 进行上线前安全预览,再通过 helmfile apply 或 sync 幂等发布。
brew install helmfile helmfile 在本地磁盘执行 helmfile.yaml Go 模板渲染、helm-diff 与多 Chart 编排,通用 MCP 工具无法完整替代。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
支持 diff --output json、--no-color、默认非交互执行 apply(除非传 --interactive)及 -l 选择器,但依赖 helm 与 helm-diff。
helmfile diff --output jsonand--no-colorsupport- Non-interactive by default unless
--interactiveis explicitly set
template 与 diff 提供完善的事前检查能力,但 apply/sync/destroy 会直接变更线上 Kubernetes 集群。
diffpreview beforeapply;destroydeletes all matched releases
自身为 Go 单二进制,但运行 diff 与 apply 必须额外安装 helm 与 helm-diff 插件。
- External dependency on
helmbinary andhelm-diffplugin
用单一 helmfile.yaml 优雅解决多 Chart、多环境 Helm 编排问题。
- Supports environment layering (
-e), selectors (-l), andhelmfile list --output json
社区活跃维护的 MIT 开源项目(helmfile/helmfile)。
- MIT-licensed
helmfile/helmfilerepository
helmfile.readthedocs.io 手册与命令行参考齐全。
- Published docs at helmfile.readthedocs.io
安全边界、鉴权与放权指南
复用 Kubernetes kubeconfig(~/.kube/config、KUBECONFIG)以及可选的 Helm 仓库/OCI 镜像库凭证。
MIT 开源 CLI 免费;下发 Chart 会在目标 Kubernetes 集群中调度计算资源。
# 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 校验。
helmfile -e staging diff --output json --no-color
通过 helm-diff 计算发布差异并输出结构化 JSON,不执行变更。
受控写入与预演
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钩子,处理不可信仓库时需留意。