If a PV got `bound` to a pvc created earlier, but realized the pvc name was wron . . .

Phani M:
If a PV got bound to a pvc created earlier, but realized the pvc name was wrong and deleted that PVC (before it didn’t get claimed by any deployment/pod). When a new PVC is created with right pvc name, it is not getting Bound.
How to make the PV’s Status as Available back again? I see it as Released.
The previously bound pvc is deleted.

controlplane $ k get pv
NAME   CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS     CLAIM             STORAGECLASS   REASON   AGE
pv-1   10Mi       RWO            Retain           Released   default/myclaim                           9m12s
controlplane $ k get pvc
NAME     STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
my-pvc   Pending                                                     73s
controlplane $ 

Here is the error I see when new pvc is created:

no persistent volumes available for this claim and no storage class is set
controlplane $ k get pv 
NAME   CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS     CLAIM             STORAGECLASS   REASON   AGE
pv-1   10Mi       RWO            Retain           Released   default/myclaim                           60m
controlplane $ 
controlplane $ 
controlplane $ k get pv pv-1 -o yaml | grep -v "f:"
apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    <http://pv.kubernetes.io/bound-by-controller|pv.kubernetes.io/bound-by-controller>: "yes"
  creationTimestamp: "2021-06-24T05:39:18Z"
  finalizers:
  - <http://kubernetes.io/pv-protection|kubernetes.io/pv-protection>
  managedFields:
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
          .: {}
          .: {}
    manager: python-requests
    operation: Update
    time: "2021-06-24T05:39:18Z"
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
          .: {}
          .: {}
    manager: kube-controller-manager
    operation: Update
    time: "2021-06-24T05:47:47Z"
  name: pv-1
  resourceVersion: "3757"
  selfLink: /api/v1/persistentvolumes/pv-1
  uid: ef7b2c76-84b9-43f8-96fd-962a59728c2a
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 10Mi
    apiVersion: v1
    kind: PersistentVolumeClaim
    name: myclaim
    namespace: default
    resourceVersion: "3298"
    uid: 21934493-05e9-4d59-b6e4-9347279ebf0e
  hostPath:
    path: /opt/data
    type: ""
  persistentVolumeReclaimPolicy: Retain
  volumeMode: Filesystem
status:
  phase: Released
controlplane $ 

Here is the manifest for pvc

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 10Mi
~                    

Tej_Singh_Rana:
Hello, @Phani M
Can you please read about Reclaim Policy?
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#retain

Gurudutt Dongre:
That is probably because of the reclaim policy set on the PV. Since it was already bound once and now the PVC got deleted it has gone to’released’ status but not available to use for new PVC’s. You might have to recreate the PV.

Phani M:
Thank you. I deleted the references to the older pvc and recreated a new PV.
Immediately it got Bound

controlplane $ k get pv 
NAME   CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM            STORAGECLASS   REASON   AGE
pv-1   10Mi       RWO            Retain           Bound    default/my-pvc                           14s
controlplane $ 
controlplane $ 
controlplane $ k get pvc
NAME     STATUS   VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
my-pvc   Bound    pv-1     10Mi       RWO                           59m
controlplane $