Kubernetes can't remove PV/PVC stuck on terminating
Quote from moshe on 08/07/2021, 12:55 amProblem
User wants to delete Persistent Volume and Persistent Volume Claim from Kubernetes cluster but resources are stuck in the following state
kubectl get pvc
task-pv-claim Terminating task-pv-volume 100Gi RWO standard 3m21s
kubectl get pv
task-pv-volume 100Gi RWO Retain Terminating default/task-pv-claim standard
Solution
first make sure there are no resources uses those PV’s and PVC’s
kubectl get all
remove with force and with grace period 0
kubectl delete pvc <PVC_NAME> –grace-period=0 –force
kubectl delete pvc task-pv-claim –grace-period=0 –force
Problem
User wants to delete Persistent Volume and Persistent Volume Claim from Kubernetes cluster but resources are stuck in the following state
kubectl get pvc
task-pv-claim Terminating task-pv-volume 100Gi RWO standard 3m21s
kubectl get pv
task-pv-volume 100Gi RWO Retain Terminating default/task-pv-claim standard
Solution
first make sure there are no resources uses those PV’s and PVC’s
kubectl get all
remove with force and with grace period 0
kubectl delete pvc <PVC_NAME> –grace-period=0 –force
kubectl delete pvc task-pv-claim –grace-period=0 –force