title: Kubernetes - How to define ConfigMap built using a file in a yaml?
body: <p>At present I am creating a configmap from the file config.json by executing:</p>
  
  <pre><code>kubectl create configmap jksconfig --from-file=config.json
  </code></pre>
  
  <p>I would want the ConfigMap to be <em>created</em> as part of the deployment and tried to do this:</p>
  
  <pre><code>apiVersion: v1
  kind: ConfigMap
  metadata:
    name: jksconfig
  data:
    config.json: |-
      {{ .Files.Get "config.json" | indent 4 }}
  </code></pre>
  
  <p>But doesn't seem to work. What should be going into configmap.yaml so that the same configmap is created? </p>
  
  <p>---UPDATE---</p>
  
  <p>when I do a helm install dry run:</p>
  
  <pre><code># Source: mychartv2/templates/jks-configmap.yaml
  apiVersion: v1
  kind: ConfigMap
  metadata:
    name: jksconfig
  data:
    config.json: |
  </code></pre>
  
  <p><strong>Note</strong>: I am using minikube as my kubernetes cluster</p>