<p>I have the following:</p>

<p>2 pod replicas, load balanced.
Each replica having 2 containers sharing network.</p>

<p>What I am looking for is a shared volume...</p>

<p>I am looking for a solution where the 2 pods and each of the containers in the pods can share a directory with read+write access. So if a one container from pod 1 writes to it, containers from pod 2 will be able to access the new data.</p>

<p>Is this achievable with persistent volumes and PVCs? if so what do i need and what are pointers to more details around what FS would work best, static vs dynamic, and storage class.</p>

<p>Can the volume be an S3 bucket?</p>

<p>Thank you!</p>

<p>There are several options depending on price and efforts needed:</p>

<ol>
<li>Simplest but a bit more expensive solution is to use <a href="https://aws.amazon.com/efs/" rel="nofollow noreferrer">EFS</a> + <a href="https://kubernetes.io/docs/concepts/storage/volumes/#nfs" rel="nofollow noreferrer">NFS Persistent Volumes</a>. However, EFS has serious throughput limitations, read <a href="https://docs.aws.amazon.com/efs/latest/ug/performance.html" rel="nofollow noreferrer">here</a> for details.</li>
<li>You can create pod with NFS-server inside and again mount NFS Persistent Volumes into pods. See example <a href="https://medium.com/platformer-blog/nfs-persistent-volumes-with-kubernetes-a-case-study-ce1ed6e2c266" rel="nofollow noreferrer">here</a>. This requires more manual work and not completely highly available. If NFS-server pod fails, then you will observe some (hopefully) short downtime before it gets recreated.</li>
<li>For HA configuration you can provision <a href="https://github.com/gluster/gluster-kubernetes" rel="nofollow noreferrer">GlusterFS</a> on Kubernetes. This requires the most efforts but allows for great flexibility and speed.</li>
<li>Although mounting S3 into pods is somehow possible using awful crutches, this solution has numerous drawbacks and overall is not production grade. For testing purposes you can do that.</li>
</ol>
