Mock 5 Question:4 (PV & PVC Question) Confused

The Question is,

Create a persistent volume called cloudstack-pv with the below properties:

- Its capacity should be 128Mi.

- The volume type should be hostpath and path should be /opt/cloudstack-pv.

Next, create a persistent volume claim called cloudstack-pvc as per below properties:

- Request 50Mi of storage from cloudstack-pv PV.

My doubt is,

There is no requirement to add storageClassName in the above asked question. But the lab is expecting to add storageClassName: manual. Any reason?

Because, In the killer.sh simulation there was a same kind of question, they didn’t add the storageClassName.

Bit Confused…

There is no explicit request to add a storageClassName to the PV or PVC, but there’s a bit of trick to this question, since there is a StorageClass defined in cluster2: local-path, which is defined as the default storage class in the cluster.

Due to the local-path SC, if you don’t define a storage class, it’s a little unclear what happens when you create the PV and a PVC. When I tried it, the PV has no storageClass defined, but the PVC is picked up by the default storageClass. I suspect that the engineer that wrote the solution, out of a bit of caution, assigned both the PV and the PVC to a storageClass (“manual” in this case) to prevent any problem.

I note that the actual grader code does NOT appear to check the storage class. But if you tried to create a pod using the PVC, due to the WaitForConsumer setting of the PVC, the pod will not bind. So you need to work around the default storage class somehow.