Can I Use a Shared Read-Only Volume Across All Pods That Automatically Updates?
Asked by
106 beats today
I'm working with a Docker-Compose setup where my application plugins are in a persistent volume. This allows me to update the plugins without needing to rebuild the image each time. I'm transitioning to Kubernetes and want something similar. My goal is to have a shared read-only volume for all my nodes and pods that automatically updates when the volume is changed. Is this feasible? If not, what alternatives could I consider for achieving this?
Answers
It seems there might be a misunderstanding about how volume updates work. Volumes donโt automatically sync changes across pods. If you set up a volume correctly, like using ReadOnlyMany, all pods will access the same volumeโs contents, but they won't see updates instantly. To share updated data, you might want to consider solutions like 'git-sync' where updates are pulled from a central source.
Reply to this answer
If youโre using a block device with a traditional filesystem, it gets tricky. Generally, you can either mount it read-only for everyone or mount it once exclusively. If updates happen on one node, other nodes wonโt be notified of those changes immediately because of caching in memory. The best approach would be to use something like git-sync or a distributed filesystem designed for this type of scenario.
Reply to this answer
Yes, you can create a ReadOnlyMany volume and mount it across all pods. Just make sure you have a compatible storage solution, like Longhorn, that supports this kind of setup.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions