Hello can we assaign a pv to a pvc using something like matchlabel? Does storage . . .

I Malla:
hello can we assaign a pv to a pvc using something like matchlabel? Does storageClassName: field in pvc helps us to assign it to a particular pv if same storageClassName is used in pv as well ?

Tej_Singh_Rana:
Hello, @I Malla
Yeah, you’re correct.
You have to keep in mind other things too, like

  1. In pvc, storage value should be equal or less than PV’s capacity.
  2. In pvc, AccessModes should be matched with the PV’s accessModes.
  3. In pvc, storageClassName should be matched with the PV’s storageClassName. (StorageClassName is specified only in case, if it’s given in the question. Otherwise, accessModes and volume size are enough.)

I Malla:
Thank you for reply @Tej_Singh_Rana
One more query is : Suppose we have 2 PV with label ==>
a . disktpye= SSD
b. disktype= HDD
with same capacity and assessModes
We have a app which requires faster data processing so we need ssd drive. So we use a pvc in that pod.
Then when we create pvc , how can we make sure that this pvc gets bound to PV with label SSD.