gpt4 book ai didi

volume - 如何防止两个卷声明在 Kubernetes 上声明相同的卷?

转载 作者:行者123 更新时间:2023-12-01 13:48:43 24 4
gpt4 key购买 nike

在我的 GKE 上的 Kubernetes 集群上,我有以下持久卷声明 (PVC):

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: registry
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi

和:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: postgresql-blobs
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi

除其他外,我定义了以下持久卷:

kind: PersistentVolume
apiVersion: v1
metadata:
name: pv0003
spec:
capacity:
storage: 100Gi
accessModes:
- ReadWriteOnce
- ReadOnlyMany
gcePersistentDisk:
pdName: registry
fsType: ext4

现在,两个声明都声明了相同的数量:

bronger:~$ kubectl describe pvc postgresql-blobs registry
Name: postgresql-blobs
Namespace: default
Status: Bound
Volume: pv0003
Labels: <none>
Capacity: 100Gi
Access Modes: RWO,ROX


Name: registry
Namespace: default
Status: Bound
Volume: pv0003
Labels: <none>
Capacity: 100Gi
Access Modes: RWO,ROX

有趣的是,PV 只知道其中一个声明:

bronger:~$ kubectl describe pv pv0003
Name: pv0003
Labels: <none>
Status: Bound
Claim: default/postgresql-blobs
Reclaim Policy: Retain
Access Modes: RWO,ROX
Capacity: 100Gi
Message:
Source:
Type: GCEPersistentDisk (a Persistent Disk resource in Google Compute Engine)
PDName: registry
FSType: ext4
Partition: 0
ReadOnly: false

如何防止这种情况发生?

最佳答案

这是一个错误,由 https://github.com/kubernetes/kubernetes/pull/16432 修复

关于volume - 如何防止两个卷声明在 Kubernetes 上声明相同的卷?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33711700/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com