在Helm v2 / v3中使用命名模板中values.yaml中的值

问题描述 投票:0回答:1

我无法从命名模板部分的values.yaml中获取值,但在该部分之外可用。

如果有人能弄清楚出什么问题,我将不胜感激。

头盔2和头盔3具有相同的行为。

简单示例模板/test.yaml

{{- define "test" -}}
# Inside define section: {{ .Values.env }}
{{- end -}}
{{ template "test"}}
---
# Outside define section: {{ .Values.env}}

values.yaml

env: env-placeholder

输出

> helm template .
---
# Source: helm-configs-template/templates/test.yaml
# Inside define section:
---
# Source: helm-configs-template/templates/test.yaml
# Outside define section: env-placeholder
kubernetes-helm
1个回答
0
投票

我已经找到了解决我问题的方法。我忘了在[>]上加点

{{ template "test" .}}
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.