Search

The PersistentVolume "efs-pv" is invalid

The PersistentVolume "efs-pv" is invalid: spec.persistentvolumesource: Forbidden: spec.persistentvolumesource is immutable after creation core.PersistentVolumeSource{ ... // 19 identical fields Local: nil, StorageOS: nil, CSI: &core.CSIPersistentVolumeSource{ Driver: "efs.csi.aws.com", - VolumeHandle: "fs-07138bba436f717a5", + VolumeHandle: "fs-0fa3b797010825bb8", ReadOnly: false, FSType: "", ... // 6 identical fields }, }\
YAML
복사
이 오류는 PersistentVolume 의 중복으로 발생합니다.

해결방안

# 바인딩된 PVC Delete kubectl get pvc -n dev-ns kubectl get pv -n dev-ns kubectl delete pvc efs-claim -n dev-ns # 강제 삭제 kubectl patch pvc efs-claim -n dev-ns -p '{"metadata":{"finalizers":null}}' # PV Delete kubectl delete pv efs-pv # 강제 삭제 kubectl patch pv efs-pv -p '{"metadata":{"finalizers":null}}' kubectl apply -f pv.yaml kubectl apply -f pvc.yaml
YAML
복사