大网数据广告活动
服务器运维问答

Google Cloud Run - How to mount FileStore / NFS?

· 52CE 我爱测

Our application requires the presence of data on two filestores. On our current Kubernetes configuration, we use a persistent volume like so: apiVersion: v1 kind: PersistentVolume metadata: name: fileserver-input spec: capacity: …

问题原文

原帖链接 · Mike Furlender · CC BY-SA 4.0

Our application requires the presence of data on two filestores. On our current Kubernetes configuration, we use a persistent volume like so:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: fileserver-input
spec:
  capacity:
    storage: 1T
  accessModes:
  - ReadWriteMany
  nfs:
    path: /mypath
    server: XX.XXX.XXX.XXX

Which we then add as a volume in our deployment:

    volumeMounts:
      - mountPath: /mypath
        name: my-path

How can this be accomplished with Cloud Run on GKE? We have tried running commands to mount the filestore in the docker container, but we have not had success because the container does not run as privileged.

Is there a way to either specify a volumeMount like on regular GKE, or to run the container in privileged mode in Cloud Run on GKE?

已采纳解答

原帖链接 · Malgorzata · CC BY-SA 4.0

Use the - -container-privileged flag to run a container with runtime privilege.

Run command similar to below:

gcloud compute instances create-with-container busybox-vm \
   --container-image docker.io/busybox:1.27 \
   --container-privileged

Remember to change image to your own.

More information you can find here: gcloud-containers.

I hope it helps.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-05-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。