<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>

<p>Binary ConfigMaps are now supported since Kubernetes version 1.10.0. From the readme notes:</p>

<blockquote>
  <p>ConfigMap objects now support binary data via a new binaryData field. When using kubectl create configmap --from-file, files containing non-UTF8 data will be placed in this new field in order to preserve the non-UTF8 data. Note that kubectl's --append-hash feature doesn't take binaryData into account. Use of this feature requires 1.10+ apiserver and kubelets. (#57938, @dims)</p>
</blockquote>

<p>See the changelog for more details: <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.10.md#apps" rel="noreferrer">https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.10.md#apps</a></p>
