将文件上传或下载到挂载在 GKE 上的 Filestore

Upload or download files to Filestore mounted on GKE

我已经在我的 Kubernetes 集群中安装了一个 Filestore 实例。我可以将一些文件从我的本地计算机上传到 Filestore 实例吗?这就像将文件上传到 google 驱动器,但在 Filestore 中。

无法连接到 VPC 网络外的 Filestore。

但是可以从 VPC 网络外的机器upload/dowload 文件到Google 存储。

所以解决方案是将文件上传到 Google 存储,然后使用执行 gsutil rsync gs://bucket mount-directory.

的 pod 将它们复制到集群中

pod可以用连接到VPC网络的VM机器代替。

因为您要上传的文件是应用程序的配置和凭据文件,所以使用 Filestore 看起来不是最佳选择。如果您需要将一些数据装载为 ReadWriteMany,Filestore 可能是合理的,因为最小卷大小为 1Tb,对于配置和凭据来说太大了。

相反,实现目标的更好方法是使用 ConfigMaps to store configuration files and Secrets to store credentials. This should be also a cheaper option:

You are charged based on the provisioned capacity, not based on the capacity used. For example, if you create a 1 TiB instance and store 100 GiB of data on it, you incur charges for the entire 1 TiB.