I have 20 VM Instance on GCE with kubernetes self install (using the following https://medium.com/edureka/install-kubernetes-on-ubuntu-5cd1f770c9e4).
I want all the pod was created on pods node read/write files from one shared storage.
Example:
pod1 on node1 write file to /some/shared/directory/pod1file.txt
pod12 on node12 read the file /some/shared/directory/pod1file.txt
...
How can I do it?
First thing to do would be to go to kubernetes volumes docs, and see from the available storage options which supports shared volumes; like gluster
or ceph
.
As coderanger is mentioning, you can also use nfs
, and go for Filestore
. The drawback is the price here. Filestore
is not cheap, to not say it is expensive. And the minimum storage to get is 1TB, I think, so if you need say 100GB storage, not possible. Now, that's the ONLY storage service you can use on GCP
, as Managed Service.
If not Filestore
you are left with creating your own gluster
, for example, or any other shared storage on GCE, and mount it into your pods.
Google offers Cloud Filestore which is hosted NFS. You can then use that with your pods.