我試圖將我的Kubernetes集羣配置爲使用本地NFS服務器來存儲持久卷。Kubernetes NFS PersistentVolumeClaim的狀態有待處理
我成立了PersistentVolume如下:
apiVersion: v1
kind: PersistentVolume
metadata:
name: hq-storage-u4
namespace: my-ns
spec:
capacity:
storage: 10Ti
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
nfs:
path: /data/u4
server: 10.30.136.79
readOnly: false
光伏看起來不錯的kubectl
$ kubectl get pv
NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM STORAGECLASS REASON AGE
hq-storage-u4 10Ti RWX Retain Released my-ns/pv-50g 49m
然後我嘗試創建PersistentVolumeClaim:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-50gb
namespace: my-ns
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
Kubectl顯示pvc狀態爲待定
$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESSMODES STORAGECLASS AGE
pvc-50gb Pending 16m
當我嘗試將卷添加到部署,我得到的錯誤:
[SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "pvc-50gb", which is unexpected., SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "pvc-50gb", which is unexpected., SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "pvc-50gb", which is unexpected.]
如何我得到的PVC到工作狀態?
試試'kubectl describe pvc pvc-50gb'並檢查'Events'部分。 – ipeacocks