Helm template error with nested label values in customConfig #417
-
I am using the vector helm chart with the values file shown below, which works as expected. role: "Agent"
customConfig:
data_dir: /vector-data-dir
api:
enabled: false
sources:
kubernetes_logs:
type: kubernetes_logs
sinks:
loki:
type: loki
inputs: [kubernetes_logs]
encoding:
codec: json
endpoint: http://loki-gateway
labels:
forwarder: "vector"
cluster: "development"
stream: "{{ .stream }}"
source_type: "{{ .source_type }}"
#k8s_pod_namespace: "{{ .kubernetes.pod_namespace }}" However, when I un-comment
I'm not sure why .source_type is working to extract the label, but .kubernetes.pod_namespace is complaining. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @gabe-sorensen ! The issue is that both Vector and Helm use |
Beta Was this translation helpful? Give feedback.
Hi @gabe-sorensen !
The issue is that both Vector and Helm use
{{ }}
for templating. You'll need to escape it in yourvalues.yaml
to ensure that Helm doesn't interpret it as a template. You can find an example of this here:https://github.com/vectordotdev/helm-charts/blob/develop/charts/vector/README.md#using-template-syntax-in-customconfig