1

We have application which is using some additional files from one catalog. Right now when some of this file is changed we need to log in to each application container clone repository and copy files to catalog. We want to automate this process without rebuilding/restarting whole application.

Is there some native approach how to handle such thing?

I was thinking about using docker volume which is use/share by all containers and when is such need to rebuild just volume. Will it work as im expecting without restarting containers which are using this volume?

Or maybe there is some better solution for such case eg like NFS volumes?

1

Have a look at PersistentVolume Access Modes matrix. What you are looking for is either ROX or RWX support. ROX is more common but you'll need some side process to update the content. RWX give you full access to change content on these volumes from any pod.

ROX support is by definition much wider, as you do not need distributed write locking, so if you can handle that (and I think that in your case it is quite probable) that would be the best choice for a shared PV where your changing data can be stored.

  • I choose NFS for persistent disk and now i can easily update files in containers. I have one more question according to this configuration. What Claims are for? In every case i can imagine we just "pointing" to exactly volume which we want to use. So what is that for? – user3069488 Jan 12 '18 at 16:37
  • Claims allow you to become infrastructure agnostic. Your PVC defines your needs, and the need is for a storage of particular size, access mode and class, you don't care how your infra will provide this. On the PV side it is completely infra related, ie. you can implement it with EBS on AWS and something completely different on your baremetal. – Radek 'Goblin' Pieczonka Jan 12 '18 at 19:48
0

It looks like you have already found a solution by making use of NFS mounted volume. There are a number of other volume options available for those who read this seeking a similar solution.

If you only need pods on a single node to be able to access a volume, the the options for Access Mode 'ReadWriteOnce' in this table display types of volumes that maybe suitable.

If you need your pods (either on the same node or different nodes) to only read information in a volume, then some of the other 'ReadOnlyMany' options may also be suitable (please see the table here).

There are also options for mounting volumes that allow read/write access to multiple nodes classed under the access mode 'ReadWriteMany' in the same table.

As there is such a large number of options, some may be more suited to each use case, but more information can be found here about the specifics for each type of volume.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.