我有以下内容pvc
(持久卷声明):
piVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-claim-web
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
和谷歌云支持的pv
(持久卷):
apiVersion: v1
kind: PersistentVolume
metadata:
name: test-pv-1
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
gcePersistentDisk:
pdName: test-1
fsType: ext4
以及存在的 Google 云中的磁盘。
如果我先创建pv
, 之后创建pvc
,kubectl get pvc,pv
将显示:
NAME STATUS VOLUME CAPACITY ACCESSMODES AGE
test-claim-web Bound test-pv-1 10Gi RWO 15s
NAME CAPACITY ACCESSMODES STATUS CLAIM REASON AGE
test-pv-1 10Gi RWO Bound default/test-claim-web 25s
但如果我删除并重新创建pv
,kubectl get pvc,pv
将显示:
NAME STATUS VOLUME CAPACITY ACCESSMODES AGE
test-claim-web Bound test-pv-1 10Gi RWO 3m
NAME CAPACITY ACCESSMODES STATUS CLAIM REASON AGE
test-pv-1 10Gi RWO Available 18s
- 为什么是
pvc
静止的Bound
? - (重新)不会
pvc
自动绑定吗?(我还观察到创建pv
afterpvc
会使状态pvc
永远等待Pending
。)
我使用以下 Kubernetes 版本:
Client Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.4", GitCommit:"3eed1e3be6848b877ff80a93da3785d9034d0a4f", GitTreeState:"clean"}
Server Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.4", GitCommit:"3eed1e3be6848b877ff80a93da3785d9034d0a4f", GitTreeState:"clean"}