【发布时间】:2019-02-23 18:01:42
【问题描述】:
我想通过在 helm 命令行中设置变量来从 values.yaml 中选择配置部分。
values.yaml 的示例部分:
aaa:
x1: "az1"
x2: "az2"
bbb:
x1: "bz1"
x2: "bz2"
configmap.yaml 的示例部分
data:
{{ .Values.outsideVal.x1 }}
预期的结果应该是这样的
data:
az1
测试 helm 输出
helm template --set outsideVal=aaa mychart
得到了这个错误
Error: render error in "./templates/configmap.yaml": template: ./templates/configmap.yaml:21:12: executing "./templates/configmap.yaml" at <.Values.outsideVal.x...>: can't evaluate field x1 in type interface {}
那么问题是如何得到预期的结果?
【问题讨论】:
标签: kubernetes kubernetes-helm go-templates