【问题标题】:Kubernetes custom jenkins chart throws error associated with override_config_mapKubernetes 自定义 jenkins 图表抛出与 override_config_map 相关的错误
【发布时间】:2021-03-16 17:24:17
【问题描述】:

我想使用最新的 jenkins.1.3.6 版本 helm chart 启动 jenkins 服务器。但是,在应用图表时,我收到了error calling include: template: no template "override_config_map" associated with template "gotpl"

错误:渲染错误 “我的图表/图表/jenkins/模板/jenkins-master-deployment.yaml”: 模板:my-chart/charts/jenkins/templates/jenkins-master-deployment.yaml:42:28: 执行 “我的图表/图表/jenkins/模板/jenkins-master-deployment.yaml”在 : 错误调用 包括:模板: my-chart/charts/jenkins/templates/config.yaml:335:3: 执行 “my-chart/charts/jenkins/templates/config.yaml”在:错误调用包括:模板:没有模板 与模板“gotpl”关联的“override_config_map”

【问题讨论】:

  • 能否请您添加有关您用于部署的标志的更多详细信息。
  • 在我的 Values.yaml 文件中,我设置了 customConfigMap: true 并且在 charts/jenkins/templates/config.yaml 中有代码 sn-p ,其中包括 override_config_map 代码 {{ else }} {{ include "override_config_map" . }} {{- end -}} {{- if .Values.master.additionalConfig }} 。但是,当我执行 helm lint 时,我得到了上述错误。
  • github.com/helm/charts/tree/master/stable/… 自定义配置映射将在未来被弃用。仅供参考
  • 您必须将 config.yaml 复制到那里提到的 templates/config.tpl。

标签: jenkins kubernetes kubernetes-helm


【解决方案1】:

正如fdlkCustomConfigMap option yields error with override_config_map missing #4040 的评论中提到的那样:

它帮助我运行helm lint my-chart 来确定我需要多少个括号。 我的config.tpl 现在看起来像这样:

{{- define "override_config_map" }}
apiVersion: v1
kind: ConfigMap
[...]
  plugins.txt: |-
{{- if .Values.Master.InstallPlugins }}
{{- range $index, $val := .Values.Master.InstallPlugins }}
{{ $val | indent 4 }}
{{- end }}
{{- end }}
{{- end }}

使用 0.16.4

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多