Can I Use a Shared Read-Only Volume Across All Pods That Automatically Updates?

0
1
Asked By CuriousCoder87 On

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?

3 Answers

Answered By TechieTimmy On

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.

Answered By CloudWizard99 On

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.

Answered By KnowItAllKaren On

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.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.