<p>My requirement is if the configmap in values.yaml contains the <strong>value</strong> DOMAIN_NAME then i want replace it with {.Values.global.domainName} please help me</p>
<p><strong>Values.yaml</strong></p>
<pre><code>global:
  infraName: abc-qa-bcd
  infraSecretRegion: us-east-1
  domainName: xyz.abcde.com

configmap:
  ALLOWED_ORIGINS: &quot;https://app.DOMAIN_NAME,https://abc-cd.DOMAIN_NAME&quot;
  CREATE_ADMIN_USER: &quot;true&quot;
  CREATE_ADMIN_CDP_API: &quot;true&quot;
  PORT: &quot;8000&quot;
</code></pre>
<p><strong>config-map.yaml</strong></p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name:  {{ .Values.metadata.name }}
  namespace: {{ .Release.Namespace }}
data:
 {{- if .Values.configmap }}
{{- range $key,$value := .Values.configmap }}
  {{$key}}: {{$value | quote}}
{{- end }}
{{- end }}
</code></pre>
<p>Thanks in advance.</p>

RajuK
<p>values.yaml</p>
<pre class="lang-yaml prettyprint-override"><code>global:
  infraName: abc-qa-bcd
  infraSecretRegion: us-east-1
  domainName: xyz.abcde.com

configmap:
  ALLOWED_ORIGINS: &quot;https://app.DOMAIN_NAME,https://abc-cd.DOMAIN_NAME&quot;
  CREATE_ADMIN_USER: &quot;true&quot;
  CREATE_ADMIN_CDP_API: &quot;true&quot;
  PORT: &quot;8000&quot;
</code></pre>
<p>config-map.yaml</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: ConfigMap
metadata:
  name:  {{ .Values.metadata.name }}
  namespace: {{ .Release.Namespace }}
data: 
  data: |-
  {{- if .Values.configmap }}
  {{- range $key,$value := .Values.configmap }}
  {{- if contains &quot;DOMAIN_NAME&quot; $value }}
  {{- $value = ($value | replace &quot;DOMAIN_NAME&quot; $.Values.global.domainName) }}
  {{- end }}
    {{ $key }}: {{ $value | quote }}
  {{- end }}
  {{- end }}
</code></pre>
<p>output</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: test
  namespace: test
data: 
  data: |-
    ALLOWED_ORIGINS: &quot;https://app.xyz.abcde.com,https://abc-cd.xyz.abcde.com&quot;
    CREATE_ADMIN_CDP_API: &quot;true&quot;
    CREATE_ADMIN_USER: &quot;true&quot;
    PORT: &quot;8000&quot;
</code></pre>
