Helm: variables in values.yaml

余生颓废 提交于 2021-01-29 05:14:37

问题


I have a need to use variables inside of values.yaml file:

app:
    version: 1.0

my_app1:
    tag: {{ .app.version }} <- version taken from appVersion. In my case tag == version

Any help will be really appreciated.


回答1:


app:
    version: 1.0

my_app1:
    tag:  {{ .Values.app.version }}

{{ .Values.app | first | default .Values.app.version }}

You can also try this EDIT - 2

{{- range $key, $value := .Values.app }}
       {{ $key }}: {{ $value }}
{{- end }}


来源:https://stackoverflow.com/questions/56685449/helm-variables-in-values-yaml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!