<p>im trying to a loop with a range in helm but using 2 variables, what i have..</p>
<p><strong>values.yaml</strong></p>
<pre><code>master:
  slave1: 
    - slave1value1
    - slave1value2
  slave2: 
    - slave2value1
    - slave2value2
</code></pre>
<p>My actual loop.</p>
<pre><code>{{- range  .Values.master.slave1 }}
        name: http://slave1-{{ . }}
{{- end }}
{{- range  .Values.master.slave2 }}
        name: http://slave2-{{ . }}
{{- end }}

</code></pre>
<p>This is actually doing what i need, the output will be like this...</p>
<p>looping on <code>.Values.master.slave1</code></p>
<pre><code>name: http://slave1-slave1value1
name: http://slave1-slave1value2
</code></pre>
<p>looping on <code>.Values.master.slave2</code></p>
<pre><code>name: http://slave2-slave1value1
name: http://slave2-slave1value2
</code></pre>
<p>This is fully working for now, the question is, can i achieve the same result using just one loop block ? i tried this.</p>
<pre><code>{{ alias := .Values.master }}
{{- range  $alias }}
        name: http://{{ . }}-{{ $alias.name }}
{{- end }}
</code></pre>
<p>But the output is not what I'm expecting, thanks in advance.</p>

<p>Hi @DavidMaze i made it work changing the order of the &quot;range&quot; in the loop.</p>
<p>This doesn't work.</p>
<pre><code>{{- $key, $values := range .Values.master -}}
{{- $value := range $values -}}
name: http://{{ $key }}-{{ $value }}
{{ end -}}
{{- end -}}
</code></pre>
<p>This work as expected :)</p>
<pre><code>{{- range $key, $values := .Values.master -}}
{{- range $value := $values -}}
name: http://{{ $key }}-{{ $value }}
{{ end -}}
{{- end -}}
</code></pre>
