<p>I was considering using secrets to mount a single file but it seems that you can only mount directory that will overwrites all the other content. How can I share a single config file without mounting a directory?</p>

<p>For example you have a configmap which contain 2 config files:</p>

<pre><code>kubectl create configmap config --from-file &lt;file1&gt; --from-file &lt;file2&gt;
</code></pre>

<p>You could use subPath like this to mount single file into existing directory:</p>

<pre><code>---
        volumeMounts:
        - name: "config"
          mountPath: "/&lt;existing folder&gt;/&lt;file1&gt;"
          subPath: "&lt;file1&gt;"
        - name: "config"
          mountPath: "/&lt;existing folder&gt;/&lt;file2&gt;"
          subPath: "&lt;file2&gt;"
      restartPolicy: Always
      volumes:
        - name: "config"
          configMap:
            name: "config"
---
</code></pre>

<p>Full example <a href="https://gist.github.com/tuannvm/0fc6e94a3759c91b1abe71c149152f77" rel="noreferrer">here</a></p>
