<p>I have a directory within container A that I would like to share with container B. </p>

<p>For example I have a directory <code>/dataabc</code> on container A.</p>

<p>I've tried using a shared <code>hostPath</code> volume, however as this is empty when mounted - it makes the existing files non accessible. (<code>/dataabc</code> would be mounted on top of the existing <code>/dataabc/</code> from container A.</p>

<p>I could copy the files over on container startup - but this requires modification to the container. Is there a more simple way that does not require modification to the container?</p>

<p>Big thanks to @graham, I could reuse the existing container with just this minor modification to the pod config:</p>

<pre><code>  initContainers:
  - args:
    - cp -r /var/www / &amp;&amp; ls -altr /www/
    command:
    - /bin/sh
    - -c
    image: example
    imagePullPolicy: Always
    name: example-init
    volumeMounts:
    - mountPath: /www
      name: webroot
</code></pre>
