【发布时间】:2020-07-30 01:20:10
【问题描述】:
我的 helm 图表中有大约 20 个 yamls + 大量依赖项,我想检查特定的渲染输出。 helm template 渲染所有 yaml 并生成一百行代码。有没有办法(即使有一个正则表达式也会很好)只呈现选定的模板(通过文件或例如名称)。
【问题讨论】:
标签: kubernetes-helm
我的 helm 图表中有大约 20 个 yamls + 大量依赖项,我想检查特定的渲染输出。 helm template 渲染所有 yaml 并生成一百行代码。有没有办法(即使有一个正则表达式也会很好)只呈现选定的模板(通过文件或例如名称)。
【问题讨论】:
标签: kubernetes-helm
-s, --show-only stringArray 仅显示从给定模板呈现的清单
如果只渲染一种资源,请使用helm template -s templates/deployment.yaml .
【讨论】:
helm template -s ./templates/deployment.yaml .,它将失败并出现错误Error: could not find template ./templates/deployment.yaml in chart
Error: could not find template ./templates/deployment.yaml in chart,因此当模板中有 if 检查时需要小心。参考:github.com/helm/helm/issues/7295#issuecomment-631151740