我有一张永久磁盘(GCP),我希望能够允许对多个pod进行读写访问。
这可能吗?这是我的两个配置:
pVolume.yaml
apiVersion: "v1"
kind: "PersistentVolume"
metadata:
name: "pv0001"
spec:
storageClassName: manual
capacity:
storage: "10Gi"
accessModes:
- "ReadWriteMany"
gcePersistentDisk:
fsType: "ext4"
pdName: "wordpress-disk"
pVolumeClaim.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: task-pv-claim
spec:
storageClassName: manual
accessModes:
- ReadWriteMany
resources:
requests:
storage: 3Gi
使用上面的配置,我在我的pod上看到以下错误:
FailedMount Failed to attach volume "pv0001" on node "xyz" with: googleapi: Error 400: The disk resource 'abc' is already being used by 'xyz'
将副本计数设置为2时会发生这种情况。
答案 0 :(得分:2)
对于不同节点上的ReadWrite模式的GCP持久性磁盘,这是不可能的:(
但有可能: