<p>Helm greenhorn. I have to "inject" a specific <code>hazelcast.xml</code> into the <code>configMap</code> with the <a href="https://github.com/hazelcast/charts/tree/master/stable/hazelcast%20helm" rel="nofollow noreferrer">chart</a>. I am supposed to <code>--set</code> <code>hazelcast.configurationFiles</code></p>

<p>I've tried several ways:</p>

<ol>
<li><pre><code>helm install stable/hazelcast --set cluster.memberCount=3 --set hazelcast.configurationFiles[0].val="$(cat k8s/hazelcast.xml)"
</code></pre></li>
<li><pre><code>helm install --name=ciao stable/hazelcast --set cluster.memberCount=3 --set hazelcast.configurationFiles[0]="\{ key: hazelcast.xml, val:$(cat k8s/hazelcast.xml)  \}"
</code></pre></li>
<li><pre><code>helm install --name=ciao stable/hazelcast --set cluster.memberCount=3   --set hazelcast.configurationFiles[0]="$(cat k8s/hazelcast.xml)"
</code></pre></li>
</ol>

<p>none of them works, and i couldn't find or understand how to correctly do it. </p>

<p>I expect that i get <code>configMap</code> correctly configured like it should be:</p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: hazelcast-configuration
data:
  hazelcast.xml: |-
    &lt;?xml version="1.0" encoding="UTF-8"?&gt;........
</code></pre>

<p>instead of this (closest result obtained with try nr 3):</p>

<pre><code> data:
 "0": |-
       &lt;?xml version="1.0" encoding="UTF-8"?&gt;
</code></pre>

Tama
<p>Following the <a href="https://github.com/hazelcast/charts/blob/master/stable/hazelcast/README.md" rel="nofollow noreferrer">README</a> example</p>

<p>you need to uncomment the configurationFiles on values and put paste your own xml file conten:</p>

<pre><code>configurationFiles:
hazelcast.xml: |-
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.10.xsd"
                 xmlns="http://www.hazelcast.com/schema/config"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;

    &lt;properties&gt;
      &lt;property name="hazelcast.discovery.enabled"&gt;true&lt;/property&gt;
    &lt;/properties&gt;
    &lt;network&gt;
      &lt;join&gt;
        &lt;multicast enabled="false"/&gt;
        &lt;tcp-ip enabled="false" /&gt;
        &lt;discovery-strategies&gt;
          &lt;discovery-strategy enabled="true" class="com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy"&gt;
          &lt;/discovery-strategy&gt;
        &lt;/discovery-strategies&gt;
      &lt;/join&gt;
    &lt;/network&gt;

    &lt;management-center enabled="${hazelcast.mancenter.enabled}"&gt;${hazelcast.mancenter.url}&lt;/management-center&gt;

    &lt;!-- Custom Configuration Placeholder --&gt;
  &lt;/hazelcast&gt;
</code></pre>

<p>but if you don't want to past the content insede the <code>values.yaml</code> you can use. File to get the content of a file in the same path</p>

<pre><code>configurationFiles:
  hazelcast.xml: |-
  {{ .Files.Get "hazelcast.xml" | indent 4}}
</code></pre>

<p><a href="https://github.com/helm/helm/blob/master/docs/chart_template_guide/accessing_files.md" rel="nofollow noreferrer">Template guide</a></p>

<p>Remember you can copy the original <code>values.yaml</code> from the chart and use <code>-f</code> to specify you own values instead of using <code>--set</code> every time.</p>
