<p>How is concurrency managed in volumes when the volumes are shared by multiple containers?</p>

<p>It is the same way how a shared path / directory / file is managed by multiple processes / applications without containers.</p>

<ol>
<li>Avoid parallel / simultaneous writes using locks, semaphores, mutexes and mutual exclusion.</li>
<li>Be careful about stale / old data when reading from shared volume.</li>
<li>Keep in mind things like eventual consistency, volume backups and data migration since the volume is shared by multiple containers.</li>
<li>Make sure that the shared volume is not corrupted. If corrupted, have a recovery plan.</li>
<li>Use dedicated storage servers so that containers can move in the cluster (<strong><code>hostPath</code></strong> and <strong><code>emptyDir</code></strong> in kubernetes do not move with pods).</li>
<li>The underlying OS, disk, storage software / driver, LVM, filesystem will also handle IO concurrency.</li>
</ol>
