Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mount persistent storage to Google Cloud Run?

I was trying to run a Docker image with Cloud run and realised that there is no option for adding a persistent storage. I found a list of services in https://cloud.google.com/run/docs/using-gcp-services#connecting_to_services_in_code but all of them are access from code. I was looking to share volume with persistent storage. Is there a way around it ? Is it because persistent storage might not work shared between multiple instances at the same time ? Is there are alternative solution ?

like image 954
vzurd Avatar asked Oct 06 '20 15:10

vzurd


2 Answers

Cloud Run is serverless: it abstracts away all infrastructure management.

Also is a managed compute platform that automatically scales your stateless containers.

Filesystem access The filesystem of your container is writable and is subject to the following behavior:

This is an in-memory filesystem, so writing to it uses the container instance's memory. Data written to the filesystem does not persist when the container instance is stopped.

You can use Google Cloud Storage, Firestore or Cloud SQL if your application is stateful.

3 Great Options for Persistent Storage with Cloud Run

What's the default storage for Google Cloud Run?

like image 139
marian.vladoi Avatar answered Nov 04 '22 02:11

marian.vladoi


Cloud Run (fully managed) has known services that's not yet supported including Filestore which is also a persistent storage. However, you can consider running your Docker image on Cloud Run Anthos which runs on GKE and there you can use persistent volumes which are typically backed by Compute Engine persistent disks.

like image 27
Donnald Cucharo Avatar answered Nov 04 '22 02:11

Donnald Cucharo