<p>Couple of possible solutions:</p>
<ol>
<li>Control the configmap from a third chart and add the third chart as a dependency in both the charts. This will duplicate the secret and can cause a skew in the values being used both the charts since if they have independent release cycles</li>
<li>Create the configmap in one namespace and refer to it using an external reference. You can see several examples of such at <a href="https://github.com/helm/charts/search?q=existingSecret&amp;type=code" rel="nofollow noreferrer">https://github.com/helm/charts/search?q=existingSecret&amp;type=code</a></li>
</ol>
<p>I personally prefer option 1 since there is explicit dependency specification and gives the ability to deploy the charts individually</p>

CC BY-SA 4.0
2020-11-10T21:48:53.243Z
2020-11-10T21:48:53.243Z
Mikhail Advani
<p>I have a couple of deployments in Kubernetes packaged using Helm. Both the deployments are different but they share the same config map.</p>
<p>When performing installation via Helm the first deployment is successful but the second deployment fails with the below error.</p>
<blockquote>
<p><strong>Error: rendered manifests contain a resource that already exists. Unable to continue with install: ConfigMap &quot;appconfig&quot; in namespace
&quot;testnamespace&quot; exists and cannot be imported into the current
release: invalid ownership metadata; annotation validation error: key
&quot;meta.helm.sh/release-name&quot; must equal &quot;app2&quot;: current value is
&quot;app2&quot;</strong></p>
</blockquote>

<kubernetes><helm>
Helm Installation fails with shared config maps
Rohit
# Helm Installation fails with shared config maps

(Asked by: username_0 on 2020-11-09)

I have a couple of deployments in Kubernetes packaged using Helm. Both the deployments are different but they share the same config map.

When performing installation via Helm the first deployment is successful but the second deployment fails with the below error.

> **Error: rendered manifests contain a resource that already exists. Unable to continue with install: ConfigMap "appconfig" in namespace
> "testnamespace" exists and cannot be imported into the current
> release: invalid ownership metadata; annotation validation error: key
> "meta.helm.sh/release-name" must equal "app2": current value is
> "app2"**

**Tags:** kubernetes, helm


---

## 1 answers

### Answer by username_1 on 2020-11-10. Score: 1

Couple of possible solutions:

1. Control the configmap from a third chart and add the third chart as a dependency in both the charts. This will duplicate the secret and can cause a skew in the values being used both the charts since if they have independent release cycles
2. Create the configmap in one namespace and refer to it using an external reference. You can see several examples of such at <https://github.com/helm/charts/search?q=existingSecret&type=code>

I personally prefer option 1 since there is explicit dependency specification and gives the ability to deploy the charts individually


---

