<p>I'm currently working with some configmaps and I've noticed, that there are some documents in the configmap having redundant values/ referencing the same value e.g.</p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: my-configmap
  labels:
    app: my-app
data:
  some_file: |-
     ...
     foo1=bar
     ...
  some_other_file: |-
     ...
     foo2=bar
     ...
</code></pre>

<p>Is it somehow possible, to use a variable instead of writing <code>bar</code> two times?
This way I wouldn't have to search every config file if <code>bar</code> changes at some point.</p>

Urr4
<p>No, it's not possible.</p>

<p>If the problems gets worse, you can always start using <a href="https://kustomize.io/" rel="nofollow noreferrer">kustomize</a> or <a href="https://helm.sh/" rel="nofollow noreferrer">Helm</a>, which allow you to create templates for your Kubernetes manifests, and use variables on those templates.</p>
