'Binding of volume to Docker Container via Kubernetes
I'm new to the area, sorry if my question sounds dumb. What I'm looking for: I have a containers pod, where one of the containers (alpine based) should read/write from/to the customer's provided file. I don't want to limit customer on how to provide file (or at least to support most common ways). And file's size might be huge sometimes (not sure if that requirement makes any difference). The more flexibility here the better. From the initial search I found there are multiple ways to bind the volume/directory to docker's container:
- Docker bind mount - sharing dir between Host and container (nice to have)
- Add a docker volume to the pod (must have)
- Mount AWS S3 bucket to docker's container (must have)
- any other ways of supplying file access to the container? Let's say from the remote machine via sftp access?
But main question - is it all possible to configure via Kubernetes? Ideally in the same yaml file that starts the containers?
Any hints/examples are very welcome!
Solution 1:[1]
It surely is possible!
Like there are volume mount for a docker container, there are volume mounts in Kubernetes as well.
This is achieved using Persistent Volume Claim, PVC.
These are Pod lifecycle independent storage classes to store the data in the volume mount.
Understand more about the concept here: https://kubernetes.io/docs/concepts/storage/persistent-volumes/
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Prasad Tamgale |
