首页 > 解决方案 > 在 xml 文件中进行模板化

问题描述

我正在通过 helm 包中的 values.yaml 进行输入,并尝试在 xml 文件中使用该值。但它失败了。请指出我做错了什么。Values.yaml 包含:

ere:
  AdmServerPort: "9090"

在文件中,我将其用作:

<Argument Name="Port" Value="{{ .Values.ere.AdmServerPort | default "9090" }}"/>

在动态编辑后,我正在使用 configmap 将其放入我的 pod 中。请帮忙。提前致谢!

编辑: 我没有粘贴错误,因为它包含整个 xml。我尝试了 helm upgrade,但由于渲染错误而失败。我还尝试更改我修改的行(仅是这些提到的行),因为它以前肯定可以工作。但这没有帮助。

Error: UPGRADE FAILED: render error in "eric-em-ere/templates/deployment-ere.yaml": template: eric-em-ere/templates/deployment-ere.yaml:25:28: executing "eric-em-ere/templates/deployment-ere.yaml" at <include (print $.Tem...>: error calling include: template: eric-em-ere/templates/configmap.yaml:14:22: executing                                                   "eric-em-ere/templates/configmap.yaml" at <tpl (.Files.Get "fil...>: error calling tpl: Error during tpl function execution for "<PoolServer>...

整个错误与 xml 模板一起出现并以:

: parse error in "eric-em-ere/templates/deployment-ere.yaml": template: eric-em-ere/templates/deployment-ere.yaml:36: bad character U+002D '-'

标签: xmlgokubernetes-helm

解决方案


推荐阅读