Share a volume between two replicas. Kubernetes

10/6/2018

I have a rabbitMQ in my project, and I want the queues on one pod to be on the other and the information on one pod to be shared with the other pod. Is there a way for you to share the same volume and both can read and write? I use GCloud.

Thank you!

-- Sermanes
google-cloud-platform
google-kubernetes-engine
kubernetes

2 Answers

10/12/2018

Actually, it is possible to share a GCEPersistentDisk volume between more than one pod. The document says it doesn't support ReadWriteMany mode, however it does support ReadWriteOnce mode. That means if a pod mounts the volume with ReadWriteOnce mode, no other pod can mount it until that pod unmounts the volume. So, this is like a locking mechanism in writing mode. On the other hand, multiple Pods can mount the volume in ReadOnlyMany.

You can review this Stack link and also this one for more information.

-- mehdi sharifi
Source: StackOverflow

10/6/2018

GCEPersistentDisk supports only ReadWriteOnce and ReadOnlyMany and not the ReadWriteMany access modes. So, it's not possible to share a volume across two containers in a RW mode. Here is the documentation on the same.

-- Praveen Sripati
Source: StackOverflow