<p>Apologies if this is a really simple question</p>
<p>I have a 2 applications that can  potentially share the same template</p>
<pre><code>applications:
  #
  app1:
    containerName: app1
    replicaCount: 10
    logLevel: warn
    queue: queue1
  #
  app2:
    containerName: app2
    replicaCount: 20
    logLevel: info
    queue: queue2
  ...
</code></pre>
<p>If I create a single template for both apps, is there a wildcard or variable i can use
that will iterate over both of the apps (i.e. app1 or app2) ? ...e.g. the bit where ive put &lt;SOMETHING_HERE&gt; below ...</p>
<pre><code>spec:
    env:
    - name: LOG_LEVEL
      value: &quot;{{ .Values.applications.&lt;SOMETHING_HERE&gt;.logLevel }}&quot;
</code></pre>
<p>Currently (which im sure is not very efficient) I have two seperate templates that each define their own app .e.g</p>
<p><strong>app1_template.yaml</strong></p>
<pre><code>{{ .Values.applications.app1.logLevel }} 
</code></pre>
<p><strong>app2_template.yaml</strong></p>
<pre><code>{{ .Values.applications.app2.logLevel }}
</code></pre>
<p>Which im pretty sure is not the way Im supposed to do it?</p>
<p>any help on this would be greatly appreciated</p>

gbt
<p>One of the solutions would be to have one template and multiple value files, one per deployment/environment</p>
<pre><code>spec:
    env:
    - name: LOG_LEVEL
      value: &quot;{{ .Values.logLevel }}&quot;
</code></pre>
<p><em>values-app1.yaml</em>:</p>
<pre><code>containerName: app1
replicaCount: 10
logLevel: warn
queue: queue1
</code></pre>
<p><em>values-app2.yaml</em>:</p>
<pre><code>containerName: app2
replicaCount: 20
logLevel: info
queue: queue2
</code></pre>
<p>then, specify which values file should be used, by adding this to helm command:</p>
<pre><code>APP=app1 # or app2

helm upgrade --install . --values ./values-${APP}.yaml
</code></pre>
<p>you can also have shared values, let say in regular <code>values.yaml</code> and provide multiple files:</p>
<pre><code>APP=app1

helm upgrade --install . --values ./values.yaml --values ./values-${APP}.yaml
</code></pre>
