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
~