<p>I'm trying to figure out how to share data between two charts in helm.</p>

<p>I've set up a chart with a sole YAML for a configmap in one chart.  Let's call the chart cm1. It defines it's name like so:</p>

<pre><code>name:  {{ .Release.Name }}-maps
</code></pre>

<p>Then I set up two charts that deploy containers that would want to access the data in the configmap in c1.   Let's call them c1 and c2.   c1 has a requirements.yaml that references the chart for cm1, and likewise for c2.  Now I have a parent chart that tries to bring it all together, let's call it p1. p1 defines c1 and c2 in requirements.yaml.  The I <code>helm install --name k1 p1</code> and I get an error:</p>

<p>Error: release k1 failed: configmaps "k1-maps" already exists.</p>

<p>I thought that when helm builds its dependency tree that it would see that the k1-maps was already defined when chart cm1 was first loaded.  </p>

<p>What's the best practice to share a configmap between two charts?</p>

<p>You haven't given a ton of information about the contents of your charts, but it sounds like both c1 and c2 are defining and attempting to install the configmap. Helm doesn't really know anything special about the dependencies, it just knows to also install them. It will happily attempt (and fail) to install the chart a second time if told to.</p>

<p>The configmap should be created and installed only as part of the parent chart. C1 and C2 should be able to reference it by name even though it isn't defined in either of them.</p>
