Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mount a bucket in a Google Run application?

My final goal is to mount a bucket inside a container to be deployed with google run.

In order to mount a bucket, I am using gcsfuse that requires a privileged container. (https://github.com/maciekrb/gcs-fuse-sample et.al...)

With a VirtualMachine I would use:

gcloud compute instances create-with-container \
    [...] \
    --container-privileged

While with google run:

gcloud beta run deploy [...] 

But it doesn't seem to have this option.

Any hint will be appreciated.

like image 208
Paolo Di Domenico Avatar asked Oct 15 '25 18:10

Paolo Di Domenico


1 Answers

My final goal is to mount a bucket inside a container to be deployed with google run.

What you are trying to do is not supported by Cloud Run.

Cloud Run has a few rules (and a few more):

  1. The container runs beginning with the first HTTP request to it.
  2. The container is eligible to be terminated after the last HTTP Request returns.
  3. Cloud Run containers are stateless.
  4. Cloud Run does not support background processes.

To use gcs-fuse in Cloud Run would require creating TCP connection that run independently of the state of the container. When Cloud Run puts the container to sleep your connections will fail.

like image 183
John Hanley Avatar answered Oct 18 '25 18:10

John Hanley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!