title: How can I store a binary file in a Kubernetes ConfigMap?
body: <p>Can one store a binary file in a <a href="http://kubernetes.io/" rel="noreferrer">Kubernetes</a> <a href="http://kubernetes.io/docs/user-guide/configmap/" rel="noreferrer">ConfigMap</a> and then later read the same content from a volume that mounts this ConfigMap?  For example, if directory <code>/etc/mycompany/myapp/config</code> contains binary file <code>keystore.jks</code>, will</p>
  
  <pre><code>kubectl create configmap myapp-config --from-file=/etc/mycompany/myapp/config
  </code></pre>
  
  <p>include file <code>keystore.jks</code> in ConfigMap <code>myapp-config</code> that can later be mapped to a volume, mounted into a container, and read as a binary file?</p>
  
  <p>For example, given the following pod spec, should <code>keystore.jks</code> be available to <code>myapp</code> at <code>/etc/mycompany/myapp/config/keystore.jks</code>?</p>
  
  <pre><code>apiVersion: v1
  kind: Pod
  metadata:
    name: myapp
  spec:
    containers:
    - name: myapp
      image: mycompany/myapp
      volumeMounts:
      - name: myapp-config
        mountPath: /etc/mycompany/myapp/config
  
    volumes:
    - name: myapp-config
      configMap:
        name: myapp-config
  </code></pre>
  
  <p>Kubernetes version details:</p>
  
  <pre><code>derek@derek-HP-EliteOne-800-G1-AiO:~/Documents/platinum/fix/brvm$ kubectl version
  Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.6", GitCommit:"ae4550cc9c89a593bcda6678df201db1b208133b", GitTreeState:"clean", BuildDate:"2016-08-26T18:13:23Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}
  Server Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.6+coreos.0", GitCommit:"f6f0055b8e503cbe5fb7b6f1a2ee37d0f160c1cd", GitTreeState:"clean", BuildDate:"2016-08-29T17:01:01Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}
  </code></pre>