Persistent volume for wwwroot/storage folder of Asp.ner Core App

12/7/2019

I have a middle size asp.net core application (online store). One of the functions is uploading pictures for products. Also, I want to host my application in Kubernetes in a cloud.

I know that a common solution to this problem is to use some S3-like file storage. But my store quite little and I don't want to complicate it very much.

So I want to use some folder in mySite/wwwroot like mySite/wwwroot/storage to storage all pictures:

  • It's simple to work with
  • I can create a simple URL for my pictures like mysite.com/storage/picture.png

  1. Is it somehow possible to map mySite/wwwroot/storage to some persistent volume?

  2. What hostname should I use? It is easy to mount images like Postgres because Postgres use some hardcoded folder to store data (/var/lib/postgresql/data).

I understand that it restricts all replicas of my site only by one node.

-- Rustam Salakhutdinov
asp.net-core
cloud-hosting
kubernetes

0 Answers