KCNA practice question 15 of 25

How does dynamic storage provisioning work?

Full set: 240 questions
Answer options
A: A user requests dynamically provisioned storage by including an existing StorageClass in their PersistentVolumeClaim. Correct answer
B: An administrator creates a StorageClass and includes it in their Pod YAML definition file without creating a PersistentVolumeClaim.
C: A Pod requests dynamically provisioned storage by including a StorageClass and the Pod name in their PersistentVolumeClaim.
D: An administrator creates a PersistentVolume and includes the name of the PersistentVolume in their Pod YAML definition file.
Correct Answer:
A. A user requests dynamically provisioned storage by including an existing StorageClass in their PersistentVolumeClaim.
Explanation

Dynamic storage provisioning in Kubernetes allows storage volumes to be created on-demand. The process is initiated by a user creating a PersistentVolumeClaim (PVC) object. Within the PVC's specification, the user specifies a storageClassName that corresponds to a pre-configured StorageClass object created by an administrator. The StorageClass defines a provisioner and parameters for creating storage. When the PVC is created, the provisioner automatically creates a corresponding PersistentVolume (PV) and binds it to the PVC, making it available for a Pod to consume.

Why Incorrect

B. Pods consume storage via a PersistentVolumeClaim, not by directly referencing a StorageClass in their definition.
C. A PersistentVolumeClaim does not include a Pod name; rather, a Pod's definition includes the name of the PVC it wishes to use.
D. This describes static provisioning, where an administrator manually creates a PersistentVolume beforehand, which is then claimed by a PVC.

References

- Kubernetes Documentation. (n.d.). Dynamic Volume Provisioning. Kubernetes. Retrieved from https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/. The documentation states: "To enable dynamic provisioning, a cluster administrator needs to pre-create one or more StorageClass objects... A user requests dynamically provisioned storage by including a storage class in their PersistentVolumeClaim."

- Kubernetes Documentation. (n.d.). Storage Classes. Kubernetes. Retrieved from https://kubernetes.io/docs/concepts/storage/storage-classes/. Section "The StorageClass Resource" explains that a PVC uses the storageClassName attribute to request a particular class.

Scroll to Top