We have a lot of static data that our apps would need for processing different requests. This data is available in many files of various sizes. We like to share these files across the kubernetes cluster.
One solution is to host these files on each node with the fixed volume path and use hostPath to read the files in the pods.
Another solution is to create a PV and let multiple pods to claim it. But this means to tie all pods to a particular node that need access to files.
Is there a better/standard way of solving this without using database?
Please note that we are running the cluster in an air-gapped network, hence cloud storage provisioning is not possible.
Persistent Volumes can be used by more than one Pod, even if they are on different nodes, if storage backend support. Check out storage options that support
ReadOnlyMany
if that data is meant to be used readonly orReadWriteMany
if it's writable. Note that in public cloud solutions, you often can't haveReadWriteMany
by providers' own driver.After you found a proper storage for your needs and deployed the driver you can create Persistent Volumes and populate them by your shared data; that's called Static Provisioning.