我可以在 GKE(带自动驾驶仪)上制作一个可以使用 ReadWritemany 的卷吗?

can i make a volume on GKE (with autopilot) that can use ReadWritemany?

我目前正在尝试创建一个 GKE 集群,并希望能够将我的 PostgreSQL pods 扩展到超过 1 个活动实例,但我遇到了我的卷的读写权限问题有没有办法让 readwritemany 在 GKE autopilot 中工作? 如果可能的话,我的 PostgreSQL pod 的热备件也会有帮助。 提前谢谢你的建议。

IIUC 您无法将 Google 的(Compute Engine 的)永久磁盘用作 ReadWriteMany。这可能记录在 cloud.google.com 上,但我找不到它。

请参阅 Kubernetes 的 Access Modes 文档,特别是 GCEPersistentDisk。这些支持 ReadWriteOnceReadOnlyMany ReadWriteMany.

可能还有其他方法,但是,您可以在 GCP 上获得 ReadWriteMany 的一种(Goole 支持的)方法是使用 Filestore。参见 Using the Filestore CSI driver

为了完整性 (!),另一种方法是使用 PostgreSQL 服务,例如 Cloud SQL for PostgreSQL

Compute Engine 永久性磁盘does not support ReadWriteMany 访问模式。

GKE Autopilot集群supports StorageType "NFS" and by default installed with Filestore CSI addon. It is important that you do not perform nfs mount in your container because Autopilot will reject privileged pod, see here for a quick guide how to use it and how much it can cost你.