<p>I want to edit the configmap and replace the values. But it should be done using a different YAML in I ll specify overriding values as part of that file.</p>

<p>I was trying using <code>kubectl edit cm -f replace.yaml</code> but this didn't work so i want to know the structure in which the new file should be.</p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: int-change-change-management-service-configurations
data:
  should_retain_native_dn: "False"
  NADC_IP: "10.11.12.13"
  NADC_USER: "omc"
  NADC_PASSWORD: "hello"
  NADC_PORT: "991"
  plan_compare_wait_time: "1"
  plan_prefix: ""
  ingress_ip: "http://10.12.13.14"
</code></pre>

<p>Now lets us assume NADC_IP should be changed and So I would like to know how should be structure of the YAML file and using which command it can be served?</p>

<p>The override taking place should only be during helm test for example when i run 
<code>helm test &lt;release-name&gt;</code>?</p>

<p>To update variable in configmap you need to take two steps:</p>

<p>First, update the value of variable:</p>

<pre><code>kubectl create configmap &lt;name_of_configmap&gt; --from-literal=&lt;var_name&gt;=&lt;new_value&gt; -o yaml --dry-run | kubectl replace -f -
</code></pre>

<p>So in your case it will looks like this:</p>

<pre><code>kubectl create configmap int-change-change-management-service-configurations --from-literal=NADC_IP=&lt;new_value&gt; -o yaml --dry-run | kubectl replace -f -
</code></pre>

<p>Second step, restart the pod:</p>

<pre><code>kubectl delete pod &lt;pod_name&gt;
</code></pre>

<p>App will use new value from now. Let me know, if it works for you.</p>
