Reputation: 1398
I have the following values.yaml:
vrIds:
- 51
- 52
51.vip: 169.254.1.1
52.vip: 169.254.1.2
I have the following template:
{{ range $index, $element := .Values.vrIds }}
vrrp.{{$element}}.vip: <<How do I get the value of $element.vip>>
{{ end }}
How do I get the value of $element.vip for each vrid?
Upvotes: 5
Views: 25095
Reputation: 28743
You need to modify your values.yaml
a little:
vrIds:
51: 169.254.1.1
52: 169.254.1.2
And use the following construction inside your template files:
{{- range $key, $value := .Values.vrIds }}
vrrp.{{ $key }}.vip: {{ $value }}
{{- end }}
Upvotes: 12