<p>I am trying to add a zip file to our configmap due to the amount of files exceeding the 1mb limit. I deploy our charts with helm and was looking into binaryData but cannot get it to work properly. I wanted to see if anyone had any suggestions on how I could integrate this with helm so when the job is finished it deletes the configmap with it</p>
<p>Here is my configmap:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template &quot;db-migration.fullname&quot; . }}
  labels:
    app: {{ template &quot;db-migration.name&quot; . }}
    chart: {{ template &quot;db-migration.chart&quot; . }}
    draft: {{ .Values.draft | default &quot;draft-app&quot; }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
binaryData:
  {{ .Files.Get &quot;migrations.zip&quot; | b64enc }}
immutable: true

---

apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template &quot;db-migration.fullname&quot; . }}-test
  labels:
    app: {{ template &quot;db-migration.name&quot; . }}
    chart: {{ template &quot;db-migration.chart&quot; . }}
    draft: {{ .Values.draft | default &quot;draft-app&quot; }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
binaryData:
  {{ .Files.Get &quot;test.zip&quot; | b64enc }}
immutable: true

</code></pre>
<p>The two zip files live inside the charts and I have a command to unzip them and then run the migration afterwards</p>

<p><code>binaryData</code> exepcts a <em>map</em> but you are passing a <em>string</em> to it.<br />
When debugging the template we can see</p>
<pre class="lang-text prettyprint-override"><code>Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: error validating &quot;&quot;: error validating data: ValidationError(ConfigMap.binaryData): invalid type for io.k8s.api.core.v1.ConfigMap.binaryData: got &quot;string&quot;, expected &quot;map&quot;
</code></pre>
<p>The way to fix this is to add a key before <code>{{ .Files.Get &quot;test.zip&quot; | b64enc }}</code>.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template &quot;db-migration.fullname&quot; . }}
  labels:
    app: {{ template &quot;db-migration.name&quot; . }}
    chart: {{ template &quot;db-migration.chart&quot; . }}
    draft: {{ .Values.draft | default &quot;draft-app&quot; }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
binaryData:
  migrations: {{ .Files.Get &quot;migrations.zip&quot; | b64enc }}
immutable: true

---

apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template &quot;db-migration.fullname&quot; . }}-test
  labels:
    app: {{ template &quot;db-migration.name&quot; . }}
    chart: {{ template &quot;db-migration.chart&quot; . }}
    draft: {{ .Values.draft | default &quot;draft-app&quot; }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
binaryData:
  test: {{ .Files.Get &quot;test.zip&quot; | b64enc }}
immutable: true
</code></pre>
