cancel
Showing results for 
Search instead for 
Did you mean: 
Igris
Mission Specialist
Mission Specialist
  • 14.2K Views

pvc stuck in terminating status

it probably wont affect me on the exam as i will have enough storage, but it will be good to learn for the future

i messed up my pvc command so i tried to --owerwrite it assuming it will just create a new pvc with the changes.however that is not the case

once i used oc delete on the first it got stuck in terminating stage. Tried the following solution : 

oc patch pvc pvc_name -p '{"metadata":{"finalizers":null}}' 

but it didnt seem to have any effect.

 

 

Labels (1)
4 Replies
flozano
Moderator
Moderator
  • 14.1K Views

Forced deletion is tricky because Kubernetes (actually etcd) has no idea of referential integrity. Resources might have dependencies and these could prevent deletion from complete. You would need to forcefully delete all dependencies and sometimes they are very hard to track.

I would need more data to pinpoint your specific issue but these posts might help:

https://www.openshift.com/blog/the-hidden-dangers-of-terminating-namespaces

https://stackoverflow.com/questions/54629660/kubernetes-how-do-i-delete-pv-in-the-correct-manner

https://stackoverflow.com/questions/51358856/kubernetes-cant-delete-persistentvolumeclaim-pvc

 

0 Kudos
Raksha
Mission Specialist
Mission Specialist
  • 13.2K Views

I had the same issue but patching helped me get rid of the pvc.

Thank you

MarkosS
Flight Engineer
Flight Engineer
  • 11.7K Views

I had the same issue and patching had an immediate effect: pvc was successfully deleted.

(Finalizers were set to snapshot.storage.kubernetes.io/pvc-as-source-protection in order to protect it while a snapshot was taken)

0 Kudos
flozano
Moderator
Moderator
  • 11.7K Views

Usually removing all finalizers from the resource does the trick. Sometimes the controller takes too long to pick the change and garbage collect the resource and setting deletionTimestamp to null, as a way of forcing immediate garbage collection of the resource may also help. For more information:

https://kubernetes.io/blog/2021/05/14/using-finalizers-to-control-deletion/

Join the discussion
You must log in to join this conversation.