Google Cloud Professional Cloud Developer — Question 275
You recently deployed an application to GKE where Pods are writing files to a Compute Engine persistent disk. You have created a PersistentVolumeClaim (PVC) and a PersistentVolume (PV) object on Kubernetes for the disk, and you reference the PVC in the deployment manifest file.
You recently expanded the size of the persistent disk because the application has used up almost all of the disk space. You have logged on to one of the Pods, and you notice that the disk expansion is not visible in the container file system. What should you do?
Answer options
- A. Set the spec.capacity.storage value of the PV object to match the size of the persistent disk. Apply the updated configuration by using kubectl.
- B. Recreate the application Pods by running the kubectl delete deployment DEPLOYMENT_NAME && kubectl apply deployment.yaml command, where the DEPLOYMENT_NAME parameter is the name of your deployment and deployment.yaml is its manifest file.
- C. Set the spec.resources.requests.storage value of the PVC object to match the size of the persistent disk. Apply the updated configuration by using kubectl.
- D. In the Pod, resize the disk partition to the maximum value by using the fdisk or parted utility.
Correct answer: C
Explanation
The correct answer is C because the PVC's requests must be updated to reflect the new size of the persistent disk for the changes to be recognized by the Pods. Option A is incorrect as only updating the PV does not affect the PVC. Option B won't resolve the issue since it doesn't involve updating the PVC. Option D is also incorrect as resizing the partition in the Pod is not the appropriate method for making the Kubernetes volume changes visible.