【问题标题】:How to upload file to Google Cloud Filestore?如何将文件上传到 Google Cloud Filestore?
【发布时间】:2021-08-15 15:35:34
【问题描述】:

我正在使用GKE,我想将 HTML 文件上传到Filestore,以便它可以被挂载的 PersistentVolume 使用。但是,Filestore 文档是 ambiguous。我已经尝试了该命令的一些变体,但我遇到了文档未涵盖的奇怪错误。这是我的 Filestore 实例:

INSTANCE_NAME  ZONE           TIER       CAPACITY_GB  FILE_SHARE_NAME  IP_ADDRESS      STATE  CREATE_TIME
filestore      us-central1-a  BASIC_HDD  1024         filestore        <ADDRESS>  READY  2021-08-15T13:30:39

图表中的成交量声明:

     volumeMounts:
      - mountPath: /filestore
        name: mypvc

我不明白我应该在 scp 命令中为client-name:/mount-directory 使用什么。

使用 3 个 gke 实例之一结果 scp: /filestore: Read-only file system

gcloud compute scp /path/to/local/file/index.tmpl gke-my-first-cluster-1-default-pool-b6dd53a7-jtqb:/filestore --project= project 

使用filestore-ip:/filestore-path 结果The resource was not found

我也尝试过的命令:

gke-my-first-cluster-1-default-pool-b6dd53a7-jtqb:/mnt/fileshare/
scp: /mnt/fileshare/: Is a directory
--
gke-my-first-cluster-1-default-pool-b6dd53a7-jtqb:/mnt/fileshare/index.tmpl
scp: /mnt/fileshare/index.tmpl: No such file or directory
--
gke-my-first-cluster-1-default-pool-b6dd53a7-jtqb:/mnt/fileshare
scp: /mnt/fileshare: Read-only file system

那么主要问题我应该在这里使用什么?

谢谢

【问题讨论】:

    标签: google-cloud-platform google-kubernetes-engine scp google-cloud-filestore


    【解决方案1】:

    将文件存储挂载为映射驱动器并上传到站点并存储在挂载的驱动器上。

    https://cloud.google.com/filestore/docs/mounting-fileshares

    【讨论】:

    • 你能澄清一下你的意思吗?我是否应该创建一个单独的 VM 实例,将 Filestore 挂载到它,然后从 GKE 挂载到该 VM 实例?我做对了吗?
    • 是的,我使用的是 GE 而不是 GKE,但它应该可以正常工作
    猜你喜欢
    • 1970-01-01
    • 2018-12-23
    • 1970-01-01
    • 2016-08-28
    • 2021-12-14
    • 2019-06-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多