Share data between pods in ReadMany mode and allow to write only for one host(WriteOnce)


Share data between pods in ReadMany mode and allow to write only for one host(WriteOnce)



We've got to write files from one host in a shared storage and share these files between many pods in read only state. Like this:



writer -> shared storage <- pod_reader_nth



I tried to use Google Persistent Storage, but k8s doesn't allow to mix ReadMany and WriteOnce. Is there any way to solve this issue simple, like use some SaaS solution and don't use CephFS/GlusterFS/NFS?



inb4: Tried Google Cloud Storage buckets, but got degraded performance when wrote a lot of files.





All volume types are listed at this link. When using ReadWriteMany to Persistent Volumes, you are limited to these options at this link. According to the same document “ a volume can only be mounted using one access mode at a time, even if it supports many.” This is true for all volume plugins listed, and not only GCEPersistentDisk. Unfortunately I can not think of an alternative easier way to directly allow pods to access persistent volumes.
– Fady
Jan 18 at 19:46




1 Answer
1



As you mentioned, you cannot use Google Persistent Storage as with the mixup of ReadMany and WriteOnce. Also, you cannot use as "ReadWriteMany" as mentioned in
https://cloud.google.com/kubernetes-engine/docs/concepts/persistent-volumes



Other alternate way would be use "hostPath" - https://kubernetes.io/docs/concepts/storage/volumes , where you can mount a directory from the host node’s filesystem into your pod. You can mount the persistent disk to the cluster nodes. The problem here is all your pods gets write access to the hostPath. It will essentially become "ReadWriteMany".






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Export result set on Dbeaver to CSV

Opening a url is failing in Swift