<p>I can create config map from a property file and use the same config files inside the POD. However, I don't want to use the configmap created in past and supplied with the helmchart. Rather in the helmchart values.yaml i want to provide a file name from where the config map will be created dynamically ..</p>

<p>Any suggestions/examples are welcome .</p>

<p>Thanks in advance -
Tutai  </p>

<p>See if the approach described in <a href="https://github.com/kubernetes/charts/issues/1310" rel="nofollow noreferrer">kubernetes/charts issue 1310</a> works for you.</p>

<blockquote>
  <p>I suggest that we allow for overriding the name of the <code>ConfigMap</code> that gets mounted to the persistent volume.<br>
  That way, the parent chart could create, and even make templates for, these <code>ConfigMaps</code>.</p>
  
  <p>For example <code>values.yaml</code> could have the following fields added:</p>
</blockquote>

<pre><code>## alertmanager ConfigMap entries
##
alertmanagerFiles:
  # ConfigMap override where full-name is {{.Release.Name}}-{{.Values.alertmanagerFiles.configMapOverrideName}}
  configMapOverrideName: ""
...

## Prometheus server ConfigMap entries
##
serverFiles:
  # ConfigMap override where full-name is {{.Release.Name}}-{{.Values.serverFiles.configMapOverrideName}}
  configMapOverrideName: ""
...
</code></pre>

<p>You can see the implementation of that issue in <a href="https://github.com/kubernetes/charts/commit/2ea776441e305cab858913e2c2806f5122df06dd" rel="nofollow noreferrer">commit 2ea7764</a>, as an example of override.</p>

<hr>

<p>This differs from a file approach, where you create a new config map and replace the old one:</p>

<pre><code>kubectl create configmap asetting --from-file=afile \
        -o yaml --dry-run | kubectl replace -f -
</code></pre>

<p>See "<a href="https://medium.com/google-cloud/kubernetes-configmaps-and-secrets-68d061f7ab5b#33e4" rel="nofollow noreferrer">Updating Secrets and ConfigMaps</a>" as an example.</p>
