PVC is deleted and the volume is gone after deleting the PVC
Environment
- OpenShift Dedicated/OSD
- Red Hat OpenShift Service on AWS Online/ROSA
- 4.x
Issue
- Why PV is gone after the PVC got deleted?
-
After deletion, the pod is now in pending status trying to search the deleted PVC with error;
Warning FailedScheduling 30m (x169 over 14h) default-scheduler 0/39 nodes are available: 39 persistentvolumeclaim "elasticsearch-elasticsearch-xxx-XXXXXXX-1" not found. preemption: 0/39 nodes are available: 39 Preemption is not helpful for scheduling.
Resolution
- Create a new PVC using the old PVC name.
- Once the PVC has been established, verify if the pod is in a running state. If it is still not running, proceed to delete the pod, prompting it to initiate the search once more.
Note:
- In
Delete
reclaim policy PV will get deleted once PVC is deleted. So you can create both with same old name. - In
Retain
reclaim policy once you delete PVC , PV will be in Released state. To use the same PV you will have to remove claimRef section from PV , that will make PV in Available state and then you can create PVC with old name and point it to available PV.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments