apiVersion: v1
kind: ConfigMap
metadata:
name: nginx
namespace: nginx-ingress
data:
nginx.ingress.tmpl: {{ (tpl (.Files.Get "nginx.ingress.tmpl") . | quote ) }}
helm中如何读取模板文件?
我收到错误
at
的 tpl 函数执行期间出错”:调用 tpl 时出错:“# 配置 for
试试这个:
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx
namespace: nginx-ingress
data:
{{- $files := .Files }}
{{- range tuple "nginx.ingress.tmpl" }}
{{ . }}: |-
{{ $files.Get . }}
{{- end }}