I want to conditionally set a 'go' variable at the top of my helm template file then use it later in the template file. Here is what I tried that doesn't work:
At the top of my template file, I do the following:
{{- if eq $.Values.kafka.create true -}}
{{- $kafka_port := 9094 -}}
{{- else -}}
{{- $kafka_port := $.Values.kafka.port -}}
{{- end }}
But when I attempt to do "helm install" I get a parse error where I use $kafka_port later in the template file. The specific error is:
Error: parse error at (tombolo/templates/tom-node-launch.yaml:89): undefined variable "$kafka_port"