<p>Here is my deployment file and I am applying it with command <code>kubectl apply -f deployment.yaml</code></p>

<pre class="lang-sh prettyprint-override"><code>    apiVersion: apps/v1
    kind: Deployment
    metadata:
        name: scan-deployment
        labels:
            app: scan
    spec:
       replicas: 1
       selector:
           matchLabels:
               app: scan
       template:
           metadata:
               labels:
                   app: scan
           spec:
               volumes:
               - name: shared-files
                 configMap:
                    name: shared-files
               containers:
               - name: scan-svc
                 image: scan:latest
                 imagePullPolicy: IfNotPresent
                 volumeMounts:
                 - name: shared-files
                   mountPath: /shared
</code></pre>

<p>Here I have my file <code>test.txt</code> file which is located in <code>./shared/test.txt</code> that I have configured using configMap.</p>

<p>Now the thing is that I have subFolder in my local disk <code>./shared/xml</code>, <code>./shared/report</code> and I want to map <code>/shared</code> with container  but not able to do it. I don't want to map config files from these subfolder. Deployed code creates report in xml and pdf format and saves it in respective folder and I want to map that to local disk.</p>

Nimesh Sommanek
<p>It would be nice, if you would tell us why you are not able to do it, but I assume it overwrites your content under <code>/shared</code>, which is an expected behavior.</p>

<p>When you map your <code>/shared</code>; on the host with <code>/shared</code> in the container, it is going to be mapped correctly, but once <code>configMap</code> gets created, it is going to overwrite the content of the path, by whatever is in the <code>configMap</code>.</p>
