<p>I've deployed the following ConfigMap with my Kubernetes <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" rel="nofollow noreferrer">DameonSet resource</a>:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: fluentd-config
  namespace: fluentd
data:
  source: &quot;#{ENV['MY_SOURCE']}&quot;
</code></pre>
<p>How can I find out what <code>source</code> evaluates to when my DameonSet is deployed?</p>
<p>I've tried the following but it doesn't help:</p>
<pre><code>kubectl describe configmaps fluentd-config
</code></pre>
<p>The output only displays the templated ConfigMap:</p>
<pre><code>Name:         fluentd-config
Namespace:    fluentd
Labels:       &lt;none&gt;
Annotations:  &lt;none&gt;

Data
====
source: &quot;#{ENV['MY_SOURCE']}&quot;
</code></pre>

Johnny Metz
<p>By default you cannot do templating of kubernetes yaml manifest files. You would have to use tools like <code>helm</code>, there are many more for this.</p>
<p>To illustrate the issue, if you do <code>kubectl create -f</code> on the below file, it would not interpolate <code>$HOME</code> variable to <code>/home/ps</code>, a literal string <code>$HOME</code> would be
assigned in<code>home-dir</code>.</p>
<pre><code>apiVersion: v1
data:
  home-dir: $HOME
kind: ConfigMap
metadata:
  creationTimestamp: null
  name: my-data-1
</code></pre>
<p>However, if you would do this imperatively , you can get the variable interpolated.</p>
<pre><code>kubectl create  cm my-data-2 --from-literal=home-dir=&quot;$HOME&quot; --dry-run=client -o yaml
apiVersion: v1
data:
  home-dir: /home/ps
kind: ConfigMap
metadata:
  creationTimestamp: null
  name: my-data-2
</code></pre>
<p>You can also do variable expansion as below:</p>
<pre><code>cat &lt;&lt; EOF |kubectl create -f -
apiVersion: v1
data:
  user-name: $USER
kind: ConfigMap
metadata:
  creationTimestamp: null
  name: my-data-3
EOF
</code></pre>
