Kubernetes: Can't delete PersistentVolumeClaim (pvc)

后端 未结 9 1735
無奈伤痛
無奈伤痛 2020-12-13 02:08

I created the following persistent volume by calling

kubectl create -f nameOfTheFileContainingTheFollowingContent.yaml

apiVersion: v1
ki         


        
9条回答
  •  攒了一身酷
    2020-12-13 02:27

    This happens when persistent volume is protected. You should be able to cross verify this:

    Command:

    kubectl describe pvc PVC_NAME | grep Finalizers

    Output:

    Finalizers: [kubernetes.io/pvc-protection]

    You can fix this by setting finalizers to null using kubectl patch:

    kubectl patch pvc PVC_NAME -p '{"metadata":{"finalizers": []}}' --type=merge
    

    Ref; Storage Object in Use Protection

提交回复
热议问题