Report this

What is the reason for this report?

Loading data into DO k8s persistent volumes

Posted on April 9, 2019

How are you folks loading data into DO hosted persistent volumes? I feel like the only way would be some side-car pod running ssh / rsync?

Since DO persistent volumes are randomly named when attached via a claim, I feel like being able to rapidly reload them is going to be important.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

Indeed, for the use-case that you’ve described I would use one of the two approaches:

  1. Sidecar Container with rsync / scp: Like you mentioned, one way to do it is by using a sidecar container within the same Pod. This container can have tools like rsync or scp installed to copy files from a remote source to the local volume shared with the main application container.

  2. Init Containers: Init containers are run before the main application container and can be used to load data into a volume. They could use tools like wget, curl, git, rsync, or scp to fetch the data.

An alternative option is to use a PVC with a block storage, and try to schedule your pods on the node that the PVC has been attached on. This isn’t as portable or scalable as the other solutions, but it might be suitable for some use-cases.

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.