0

After a high load problem that triggered my pod evicted in the deployment, even after deleting the deployment and creating it again, I am getting the following problem:

  Warning  FailedMount  15s    kubelet            Unable to mount volumes for pod "XXX(YYY)": timeout expired waiting for volumes to attach or mount for pod "qa"/"XXX". list of unmounted volumes=[ZZZ-volume]. list of unattached volumes=[shared dockersocket ZZZ-volume default-token-kks6d]

The PV is RWO mode so it can only be attached to one POD at a time. I guess the system still has the PV as attached to the evicted pod (which I have deleted) so it does not allow it to be attached to a new POD.

How can I "free" my PV/PVC so it can be attached to the new POD?

Edit: I added get PV and get PVC outputs as requested:

kubectl get pvc:
XXX-pvc-default   Bound    pvc-XXX-7d98-11ea-91c2-XXX   5Gi        RWO            default                   469d

kubectl get pv:
pvc-XXX-7d98-11ea-91c2-XXX   5Gi        RWO            Delete           Bound    qa/XXX-pvc-default          default                            469d
Jonas
  • 121,568
  • 97
  • 310
  • 388
icordoba
  • 1,834
  • 2
  • 33
  • 60
  • what does `kubectl get pv,pvc` shows ? – P.... Jul 26 '21 at 18:25
  • I added the output in the description. Shall I include yaml output? – icordoba Jul 26 '21 at 19:17
  • try running following: `kubectl get pv pvname -o jsonpath='{.spec.claimRef}'`, then delete your `pvc` (keep a record of it) then `kubectl patch pv pv-name -p '{"spec":{"claimRef": null}}'`,. here 1st command would print any present claim referenced by the pv-pvc. 2nd command would clean the claim reference, this means make it available to bound. then create `pvc` again. This should reset eveything with the `pv-pvc` mapping. – P.... Jul 26 '21 at 19:42
  • The PV has a Reclaim Policy "Delete". Don't I risk loosing the PV if I delete the PVC or deleting the PVC won't affect the PV? Thanks a lot. – icordoba Jul 26 '21 at 22:13
  • Also, what do you mean by "Keep a record of it" when deleting a PVC? – icordoba Jul 26 '21 at 22:15
  • And... last one: After deleting the PVC, how should I create the PVC linked to the exiting PV? – icordoba Jul 26 '21 at 22:18
  • yes, you may loose the data already on the pv. about keeping the record 'kubect get pvc -o yaml >somefile.yml` – P.... Jul 26 '21 at 22:27
  • I have found similar issue to yours: https://stackoverflow.com/questions/55477168. Does this answer your question? – Mikołaj Głodziak Jul 27 '21 at 09:57
  • Thanks but no. In that example the solution basically explains that eventually the PVC is mounted and the pod starts. Not my case. It won’t mount it And the pod won’t start. – icordoba Jul 28 '21 at 10:45

0 Answers0