首页 > 解决方案 > 如何将文件上传到 Google Cloud Filestore?

问题描述

我正在使用GKE,我想将 HTML 文件上传到Filestore,以便安装的 PersistentVolume 可以使用它。但是,Filestore 文档是模棱两可的。我已经尝试了该命令的一些变体,但我遇到了文档未涵盖的奇怪错误。这是我的 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-platformgoogle-kubernetes-enginescpgoogle-cloud-filestore

解决方案


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

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


推荐阅读