<p>We have helm charts to deploy our application. We use a <code>configuration.json</code> file for application properties and load them to config map. But users typically use their own configuration file. </p>

<p>Default configuration.json file is packaged inside helm charts under data directoty. This file is read as </p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
{{ (.Files.Glob .Values.appConfigFile).AsConfig | indent 4}}
</code></pre>

<p>And in values</p>

<pre><code>appConfigFile: data/configuration.json
</code></pre>

<p>If users install our charts directly from repository how can this configuration file be overriden? doing <code>--set appConfigFile=/path/to/custom.json</code> doen't populate config map.</p>

<p>If charts are untarred to a directory they can add the custom configuration file into charts directory and give the configuration file using <code>--set appConfigFile=customData/custom.json</code> works </p>

<p>Can file overrides be achieved when charts are deployed from repository directly?</p>

Dheeraj Joshi
<p>Adding custom configuration to a values file and execute <code>helm install</code> using <code>-f</code> flag is a solution.</p>

<p>customValues.yaml</p>

<pre><code>overrideConfig: true
customConfig:{
//Add your custom json here as variable value
}
</code></pre>

<p>Config map yaml </p>

<pre><code>#If custom values file passed then overrideConfig variable will be set. 
#So load configmap from customConfig variable
{{ if .Values.overrideConfig}}
    app-config.json : |-
      {{ toJson .Values.customConfig }}
{{ else }}
# Else load from the default configuration available in charts.
{{ (.Files.Glob .Values.appConfigFile).AsConfig indent 4 }}
{{ end }}
</code></pre>

<p>If custom configuration is needed </p>

<pre><code>helm install -f customValues.yaml repo/chartName
</code></pre>

<p>Not sure if this is the perfect solution, but ended up taking this route.</p>
