<p>I need to place a config file default.json in a container mountPath that already have other config files. The way I tried to do this, seems to overwrite the path causing the system not to see the other files in the same directory.</p>

<p>Any ideas how I can do this?</p>

<p>The below code hide the other files from the system.</p>

<pre><code>initContainers:
        - name: install
          image: busybox
          command:
          - wget
          - "-O"
          - "/usr/share/nginx/html/config/default.json"
          - https://s3.eu-central-1.amazonaws.com/.../default.json
          volumeMounts:
            - name: console-config
              mountPath: "/usr/share/nginx/html/config"      
      volumes:
        - name: console-config
          emptyDir: {}
</code></pre>

Anton Swanevelder
<p>Using subPath field, you can mount the directory or file without overwriting other files, you can find  more information here <a href="https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath" rel="nofollow noreferrer">subPath</a></p>

<pre><code>   initContainers:
        - name: install
          image: busybox
          command:
          - wget
          - "-O"
          - "/usr/share/nginx/html/config/default.json"
          - https://s3.eu-central-1.amazonaws.com/.../default.json
          volumeMounts:
            - name: console-config
              mountPath: "/usr/share/nginx/html/config"
              subPath: config                      
      volumes:
        - name: console-config
          emptyDir: {}
</code></pre>
