如何在Google Run应用程序中安装存储桶? [英] How to mount a bucket in a Google Run application?

查看:49
本文介绍了如何在Google Run应用程序中安装存储桶?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的最终目标是将一个桶装到要与Google run一起部署的容器中.

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

为了安装存储桶,我正在使用gcsfuse,它需要一个特权容器.( https://github.com/maciekrb/gcs-fuse-sample 等.等等...)

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

在使用VirtualMachine时,我将使用:

With a VirtualMachine I would use:

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

在使用Google运行时:

While with google run:

gcloud beta run deploy [...] 

但是它似乎没有这个选项.

But it doesn't seem to have this option.

任何提示将不胜感激.

推荐答案

我的最终目标是将一个水桶安装在要部署的容器内使用Google Run.

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

Cloud Run不支持您要执行的操作.

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

Cloud Run有一些规则(还有其他一些规则):

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

  1. 该容器从对其发出的第一个HTTP请求开始运行.
  2. 上一次HTTP请求返回后,容器可以终止.
  3. Cloud Run容器是无状态的.
  4. Cloud Run不支持后台进程.

要在Cloud Run中使用gcs-fuse,需要创建独立于容器状态运行的TCP连接.当Cloud Run使容器进入睡眠状态时,您的连接将失败.

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.

这篇关于如何在Google Run应用程序中安装存储桶?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆