首页 > 解决方案 > Kubernetes 自定义 jenkins 图表抛出与 override_config_map 相关的错误

问题描述

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

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

标签: jenkinskuberneteskubernetes-helm

解决方案


正如fdlk在对 CustomConfigMap 选项的评论中提到的那样会产生 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


推荐阅读