title: kubernetes: how to export existing env variables for ConfigMap file
body: <p>when try to export a value (CONSUL_DNS_SERVICE_HOST) from my env variables from my configMap file, I receive a error - PSB</p>
  
  <pre><code># From my container:
  &gt; printenv CONSUL_DNS_SERVICE_HOST 
  10.100.180.151
  
  &gt; kubectl -n kube-system get configmap coredns -o yaml 
  apiVersion: v1
  data:
    Corefile: |
      .:53 {
          errors
          log
          health
          kubernetes cluster.local 10.0.0.0/24
          rewrite name . .default.svc.cluster.local
          prometheus :9153
          proxy . /etc/resolv.conf
          cache 30
          reload
      }
      consul:53 {
          log
          errors
          cache 30
          proxy . "$(printenv CONSUL_DNS_SERVICE_HOST)"
  
  &gt; kubectl logs --tail=20 -f coredns-7bcbfc4774-4n9p7 -n kube-system
  2019/01/10 11:15:59 plugin/proxy: not an IP address or file: "$(printenv CONSUL_DNS_SERVICE_HOST)"
  
  </code></pre>
  I find no way to retrieve the IP of CONSUL_DNS_SERVICE_HOST
  
  <p>thanks</p>