<p>I am new to the storage concepts in Kubernetes.
I need to have some common persistent storage in the Kubernetes cluster but also to be able to write to it from outside of the cluster on-prem environment..</p>
<p>So my question is, Can we have some persistent storage (of a file system) in Kubernetes cluster that can be shared among different pods, and also applications from outside the Kubernetes cluster will be able to write to it? if yes, what is the proper architecture for it? how can I access that persistent storage from outside of the cluster?</p>
<p>if it's not possible, is there a better way to achieve my need to have some common database file system for podes in the cluster and applications outside the cluster?</p>

<p>Having a filesystem shared inside the cluster between multiple pods is doable with any persistent volume marked as ReadWriteMany, like a <a href="https://kubernetes.io/docs/concepts/storage/volumes/#nfs" rel="nofollow noreferrer">NFS</a>. However for the NFS you will need to have a Kubernetes &quot;addon&quot; that manages its creation and deletion that is specific to your infrastructure.</p>
<p>I don't know how it will react if it is modified from outside the cluster but if what you need is just to have a database shared between the cluster an outsider application then it may be easier to have a regular database on a machine outside the cluster.</p>
<p>In fact you mostly want a distributed database on a kubernetes cluster for high availability, not performance, and most implementation seem to favor local storage with synchronization implemented inside the application (leader election and so on) over shared volumes.</p>
<p>If you want performances, you may take a look at <a href="https://en.wikipedia.org/wiki/Shard_(database_architecture)" rel="nofollow noreferrer">sharding</a> your database.</p>
