Clarifications on CKA Exam Scenarios: PV/PVC Binding, etcd Backup Restore, Multi-Container Pods, and Images for Testing Connectivity

I have the following doubts regarding certain scenarios or questions I may encounter in the CKA exam and would appreciate some clarifications prior to taking the exam:

##########
Question 1
##########

In some mock exam questions, the PersistentVolume (PV) was unbound from the PersistentVolumeClaim (PVC) because the PVC was requesting more storage than the PV could provide. In that case, what should be done? Should the PVC be deleted and recreated with a smaller storage request to fit within the PV's available storage, or should the PV be edited to match the PVC's request? If we edit the PV and set its ReclaimPolicy to Retain, will the existing data be lost? Additionally, if the PV is deleted and the storage is using hostPath, will the data be retained, given that the hostPath folder path is not deleted? Which method should be followed in such a situation? Also, could you please assist with the correct method for resizing a PVC?

##########
Question 2
##########

In Question 13 of CKA Mock Exam 4, the task is to restore an etcd backup stored at the path /opt/cluster1_backup_to_restore.db on the cluster1-controlplane node. The question specifies using /root/default.etcd as the --data-dir and restoring it on the same cluster1-controlplane node.

Should we only restore the snapshot to the --data-dir location as mentioned in the question, or should we follow the full procedure, which involves changing the data-dir location in the etcd manifest and restarting the kubelet? There is some confusion in this question because the evaluation seems to only check whether the snapshot is restored to the specified --data-dir location. Does the term "restore" here refer to the full process, which includes changing the data-dir in the etcd manifest and restarting the kubelet? Please clarify.

##########
Question 3
##########

Is there a preferred order for specifying containers in a multi-container pod manifest? Specifically, should the main container always come first, followed by the sidecar container, or does the order not matter?

##########
Question 4
##########

Do we need to know the specific container images that we should use for testing connectivity from a pod, equipped with tools like curl, wget, nslookup, and netcat? Should we be familiar with these images in advance, or will the question provide the necessary images for testing pod connectivity to other pods or services for troubleshooting?

Hello
In response to the above

  1. It depends on what the question requires. More often you will need to adjust PVC to fit with what any pre-deployed PV has.
  2. If the question gives a specific location for --data-dir then you should use it. You would then need to edit the volumes section of etcd manifest to point to the new data dir. This has the desirable side-effect of stopping and restarting etcd to pick up the new directory. Note that once the new exam syllabus takes effect, etcd backup/restore is no longer tested so you would not get a question on it.
  3. In the containers: section of the manifest, it is order-independent. All the containers are started simultaneously. Order is only significant for initContainers:.
  4. It helps. The image wbitt/network-multitool has all the tools you would ever need for troubleshooting. Try it out in a lab.

Hi,

@Alistair_KodeKloud

In a Kubernetes scenario where both a Persistent Volume (PV) and a Persistent Volume Claim (PVC) are unbound, how do you determine whether to resize the PVC or the PV?

I encountered a mock exam question that required resizing both a PV and a PVC. In both cases, the PV and PVC were unbound, and I was unsure whether to edit and recreate the PVC or the PV. Could you explain the decision-making process for when you should resize the PVC versus when you should resize the PV?

Additionally, are there any specific keywords or phrases in the question that would indicate whether the focus should be on resizing the PVC or the PV? How can we identify which action to take based on the wording of the question?

Hi,
@Alistair_KodeKloud

Thank you for your response! However, I am still unclear about the procedure for restoring the snapshot, specifically in the context of the question from Question 13 of CKA Mock Exam 4.

You mentioned that when a specific --data-dir location is provided, I should restore the snapshot to that directory, and then edit the volumes section of the etcd manifest to point to the new directory. This would also have the side effect of stopping and restarting etcd, which seems to align with the correct behavior. However, the solution provided in the mock exam question only mentions restoring the snapshot to the specified --data-dir location, and it doesn’t mention editing the etcd manifest or restarting the kubelet.

Could you please clarify whether the process should include editing the etcd manifest and restarting the kubelet, or if restoring the snapshot to the specified --data-dir is sufficient for the task in this particular case?

Just to clarify, I’m taking the exam within the next three days, before the new exam syllabus takes effect, as mentioned on the Linux Foundation page. A quicker response would really help me in finalizing my preparation before the exam.

Which mock exam question about PV/PVC?

That I did! Yes it would seem that the solution is incomplete, but note that what I said is an absolute. It will not work if you do not do that!

The default volumes for etcd are

  volumes:
  - hostPath:
      path: /etc/kubernetes/pki/etcd
      type: DirectoryOrCreate
    name: etcd-certs
  - hostPath:
      path: /var/lib/etcd
      type: DirectoryOrCreate
    name: etcd-data

If the --data-dir for the restore is something other than /var/lib/etcd then you must edit the hostpath’s path to the new path given for --data-dir

You don’t need to restart kubelet. It will notice itself that you edited the manifest and will restart etcd for you.