CKAD mock exam 5, Q 4

there is a default storage class on the cluster, named local-path. this storage class gets linked to PVCs that do not have explicit storageClassName defined, and it will do 2 things:

  • apply volumeBindingMode: WaitForFirstConsumer, which prevents pvc-to-pv binding until first consumer pod is created
  • it has a provisioner to create new PVs when no existing PV matches the claim

because of this, my solution to the question was either to explicity set empty storageCLassName on the PVC to prevent local-path class involvement, or to set local-path storage class on PV so it is matched with the PVC (then create the first consumer pod to get the pvc in bound state).

the given solution on lab used something different that I find confusing, it sets storage class on pv and pvc to “manual” (i don’t know from where this “manual” class came)

I want to hear thoughts about which of above three approaches makes more sense and would be suitable for the actual exam

I think that the question is “underspecified” – there’s no reason you should be expected to know that the storageClassName must be set, much less that it should be “manual”.

Then what is your suggestion if given that question to answer yourself.

if you leave storageClassName empty (as would anyone initially do) then you will not get the PV and PVC in bound state at all (because of local-path storage class being applied by default).

if you say you will go with something like storageClassName=manual as per the lab answer, then pv and pvc will be bound as needed, but I would ask "what is the trigger to use storageClassName=manual "