Closed thlr1 closed 1 month ago
After days of experimenting and looking around, I get it the moment I actually ask for help ^^'.
As I found out in the source code, storage classes must match for a PV-PVC bind to happen.
When no storageClassName is specified for the PVC, it will use the default storage class (called standard
) but it turns out that this doesn't happen with PVs meaning they are left with no storage classes, hence the mismatch. I manually added the standard storageClass to the PV and the volumes bounded beautifully.
Also, I confirm that the pod is important because of the WaitForFirstConsumer
binding mode.
Hi, I can't seem to figure out PV / PVC binding. I have been trying to use a local volume in a pod but I can't get the volumes to consistently bind together. Here is a basic setup to try:
The volume shows
Available
but the pvc won't ever bind.I have tried:
matchLabels
selector - this is the method that I would like to usevolumeName
in the pvc - not ideal to meclaimRef
with the pvc name in the pv. That actually is the only way I have been able to bind the volume, but again, I would rather not write the exact object namesDoes this have something to do with the
WaitForFirstConsumer
mode of the rancher storage class? I have tried to throw in a pod to use the pvc but it has not worked:What am I missing?
Thank you very much for your help