I understand that EBS
volumes are currently only ReadWriteOnce
.
However, I have been able to have a persistent volume
shared between two or more pods
, if those pods
get started almost at the same time. One of them writes to the volumes, and the other one(s) only reads some files.
This approach has not been successful all time: It seems that if for any reason the read-only pod
gets created ahead of the main pod
, the main pod
would get indefinitely stuck at ContainerCreating
status with Multi-Attach error for volume ...
warning.
Any advise? Thanks.
One solution that I have successfully tried was to add an initContainers
to the read-only pods
with a long sleep
command there to make sure they do not get created before the main pod
.