Came across this question in the Ultimate CKA Mock Exam Lab:
SECTION: STORAGE
For this question, please set the context to cluster1 by running:
kubectl config use-context cluster1
Create a storage class called orange-stc-cka07-str as per the properties given below:
-
Provisioner should be kubernetes.io/no-provisioner.
-
Volume binding mode should be WaitForFirstConsumer.
Next, create a persistent volume called orange-pv-cka07-str as per the properties given below:
-
Capacity should be 150Mi.
-
Access mode should be ReadWriteOnce.
-
Reclaim policy should be Retain.
-
It should use storage class orange-stc-cka07-str.
-
Local path should be /opt/orange-data-cka07-str.
-
Also add node affinity to create this value on cluster1-controlplane.
Finally, create a persistent volume claim called orange-pvc-cka07-str as per the properties given below:
-
Access mode should be ReadWriteOnce.
-
It should use storage class orange-stc-cka07-str.
-
Storage request should be 128Mi.
-
The volume should be orange-pv-cka07-str
I got everything right on this question except for the pvc part.
PVC was stuck in pending mode because it would not bind because of the volume binding mode was
set at WaitForFirstConsumer as per the instructions for creating the storage class. The instruction did not say create a pod that uses this pvc or does it state in the solution that we are
supposed to either. Regardless I tried to create a pod that used this pvc but it did not work. The pod
was stuck in pending saying the node could not find a pv to use. I tried changing the storage class bind mode to immediate but then it said that was an immutable change. I then ran out of time to do anymore.