Kubeconform
$ kubeconform 社区开源 低风险Kubeconform(kubeconform)可依据官方 OpenAPI Schema 与自定义 CRD Schema 高速校验 Kubernetes YAML/JSON 清单。纯本地只读运行,支持 -strict、-kubernetes-version、-output json 与规范退出码,非常适合作为 Agent 与 CI 护栏。
brew install kubeconform kubeconform 可毫秒级校验本地 YAML 文件或 helm template 管道输出并返回 -output json,完全无需集群访问或 MCP。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
支持 -output json、标准输入流式校验、-strict 严格模式、零交互与规范失败退出码。
- Supports
-output json,-strict, and-summary - Reads files, directories, or stdin pipes deterministically
完全只读的本地校验器,无需集群凭证、不修改文件、零远端副作用。
- Zero auth required; pure read-only schema check
静态 Go 单二进制,支持 Homebrew、go install 与三平台发布包,零外部依赖。
- Zero-dependency Go binary via
brew install kubeconform
在执行 kubectl apply 或提交 GitOps 前亚秒级拦截 API Schema 错误。
- Fast parallel manifest validation with CRD schema catalog support
社区广泛采用的 Apache-2.0 项目(yannh/kubeconform)。
- Apache-2.0
yannh/kubeconformrepository
README 详尽说明了 CRD -schema-location 模板与 -h 参数。
- Repository README and
kubeconform -h
安全边界、鉴权与放权指南
无需任何认证凭证;仅在本地读取内置或缓存的 JSON Schema 进行校验。
Apache-2.0 开源 CLI,100% 免费本地校验。
# Kubeconform Agent Rules - Run `kubeconform -strict -output json <path>` after editing any Kubernetes YAML or Helm chart. - Pass `-schema-location default` plus custom CRD schema locations or `-ignore-missing-schemas` when validating CRDs offline.
Agent 高频安全命令配方
只读查询(安全推荐)
kubeconform -strict -kubernetes-version 1.31.0 -output json ./k8s/
对照 Kubernetes 1.31.0 Schema 校验 ./k8s/ 下全部清单并输出结构化 JSON 诊断。
helm template my-app ./chart | kubeconform -strict -ignore-missing-schemas -summary
将 Helm 模板渲染的 YAML 管道送入 kubeconform 并输出简洁汇总。
核心优势
- + 纯本地只读校验闭环,支持
-output json与-strict。 - + 可直接通过 stdin 无缝校验
helm template或kustomize build输出。 - + 单 Go 二进制极速启动,无需连接集群。
注意事项与踩坑点
- ! 采用 Go 单短横线参数风格(
-output json、-strict)而非双短横线(--output)。 - ! 首次校验未缓存的 Schema 版本需联网拉取 JSON Schema,离线环境需提前准备
-cache或本地 Schema 包。