我helmfile
用来安装我的 Helm 图表和其他依赖关系图表。我想在值文件中使用模板化值。
从这个已解决的问题来看,似乎支持值文件中的模板化。但是,我使用以下文件进行了测试
helmfile.yaml
:
environments:
default:
values:
- my:
port: 8080
---
repositories:
- name: incubator
url: https://kubernetes-charts-incubator.storage.googleapis.com
releases:
- name: haproxy-ingress
namespace: haproxy-ingress
chart: incubator/haproxy-ingress
version: 0.0.27
values:
- values.yaml
values.yaml
:
controller:
tcp:
1936: "my_namespace/my-service:{{ .Values.my.port }}"
如果我跑步helmfile template
,我会得到
COMBINED OUTPUT:
Error: template: haproxy-ingress/templates/tcp-configmap.yaml:16:31: executing "haproxy-ingress/templates/tcp-configmap.yaml" at <tpl $value $>: error calling tpl: error during tpl function execution for "my_namespace/my-service:{{ .Values.my.port }}": template: haproxy-ingress/templates/tcp-configmap.yaml:1:34: executing "haproxy-ingress/templates/tcp-configmap.yaml" at <.Values.my.port>: nil pointer evaluating interface {}.port
Use --debug flag to render out invalid YAML
如果我内联值,它可以工作
environments:
default:
values:
- my:
port: 8080
---
repositories:
- name: incubator
url: https://kubernetes-charts-incubator.storage.googleapis.com
releases:
- name: haproxy-ingress
namespace: haproxy-ingress
chart: incubator/haproxy-ingress
version: 0.0.27
values:
- controller:
tcp:
1936: "my_namespace/my-service:{{ .Values.my.port }}"