<p>I have a <code>ConfigMap</code> where I have defined some environment variables like <code>log_level..</code> and referencing them in the deployment.</p>
<pre><code>          envFrom:
        - configMapRef:
            name: test_config_map
</code></pre>
<p>After deployment, I have changed some of the values in the config map and restarted the pods.</p>
<pre><code>kubectl edit configmap test_config_map
</code></pre>
<p>When I upgrade the helm chart, the modified values are overridden with the default values.</p>
<p>I assume that helm v3 3-way merge will take of the live state and keep the older values. But it doesn't seems to be the case.</p>
<p>Is there any way I can keep the modified values even after upgrade?</p>

PGS
<p>This is a community wiki answer posted for better visibility. Feel free to expand it.</p>
<p>As already mentioned in the comments, the best practice is to have your resource definitions, or in the case of using helm charts, your <code>values.yaml</code> files stored in your code repository and not changing things manually on your cluster as this leads to a configuration drift and makes it hard to restore the exact previous version in case of an outage or other emergency.</p>
<p>See the <a href="https://kubernetes.io/docs/concepts/configuration/overview/" rel="nofollow noreferrer">Configuration Best Practices</a>.</p>
