<p>Previously we only use <code>helm template</code> to generate the manifest and apply to the cluster, recently we start planning to use <code>helm install</code> to manage our deployment, but running into following problems:</p>
<p>Our deployment is a simple backend api which contains &quot;Ingress&quot;, &quot;Service&quot;, and &quot;Deployment&quot;, when there is a new commit, the pipeline will be triggered to deploy.
We plan to use the short commit sha as the image tag and helm release name. Here is the command
<code>helm upgrade --install releaseName repo/chartName -f value.yaml --set image.tag=SHA</code></p>
<p>This runs perfectly fine for the first time, but when I create another release it fails with following error message</p>
<pre><code>rendered manifests contain a resource that already exists. Unable to continue with install: Service &quot;app-svc&quot; in namespace &quot;ns&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;rel-124&quot;: current value is &quot;rel-123&quot;
</code></pre>
<p>The error message is pretty clear on what the issue is, but I am just wondering what's &quot;correct&quot; way of using helm in this case?</p>
<p>It is not practical that I uninstall everything for a new release, and I also dont want to keep using the same release.</p>

user2501711
<p>You are already doing it &quot;right&quot; way, just don't change <code>release-name</code>. That's key for Helm to identify resources. It seems that you previously used different name for release (<code>rel-123</code>) then you are using now (<code>rel-124</code>).</p>
<p>To fix your immediate problem, you should be able to proceed by updating value of annotation <code>meta.helm.sh/release-name</code> on problematic resource. Something like this should do it:</p>
<pre><code>kubectl annotate --overwrite service app-svc meta.helm.sh/release-name=rel-124
</code></pre>
