<p>I have following spring YAML structure:</p>

<pre><code>catalogParamter:
  - name: kota
    street: xxx
  - name: yyy
    street: kkkk
</code></pre>

<p>now I want those values to come from values YAML in helm chart </p>

<p>in spring YAML  catalogParamter: ${CATALOG_PARAMETER}
and defined it in deployment yaml and config yaml</p>

<p>and values coming from values YAML</p>

<p>how to represent  catalogParamter  in values YAML.</p>

<p>There are different options here. I'd suggest putting the <a href="https://github.com/trisberg/devoxx-spring-boot-k8s/blob/master/actors/config/actors-config.yaml" rel="nofollow noreferrer">application.yaml in a ConfigMap</a>. You could then expose properties in your values file with:</p>

<pre><code>properties:
  catalogParamter:
    - name: kota
      street: xxx
    - name: yyy
      street: kkkk
</code></pre>

<p>And populate the data section of your ConfigMap with:</p>

<pre><code>data:
  application.yaml: |-
{{ toYaml .Values.properties | indent 4 }}
</code></pre>

<p>You can <a href="https://github.com/trisberg/devoxx-spring-boot-k8s/blob/master/actors/config/actors-deployment.yaml#L51" rel="nofollow noreferrer">then mount that ConfigMap</a> into the <code>/config</code> directory so that the spring boot app will <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config-application-property-files" rel="nofollow noreferrer">automatically read it</a>.</p>

<p>If instead you use environment variables then you can map complex properties to environment variables with Spring boot's <a href="https://github.com/spring-projects/spring-boot/wiki/Relaxed-Binding-2.0" rel="nofollow noreferrer">relaxed binding</a>. Coding that conversion in your chart could be tricky but your case seems to be name-value pairs so I think it could be done with helm's range function.  </p>

<p>Another different pattern is to expose the <a href="https://hackernoon.com/the-art-of-the-helm-chart-patterns-from-the-official-kubernetes-charts-8a7cafa86d12" rel="nofollow noreferrer">option to set env vars directly to the user</a>. But the disadvantage of this is the user would have to understand the env var format, which may not be intuitive with relaxed binding. </p>
