KCNA · Question #61
Which resource do you use to attach a volume in a Pod?
The correct answer is D. PersistentVolumeClaim. To attach a volume to a Pod, you must reference a PersistentVolumeClaim (PVC) within the Pod's configuration. The PVC acts as a request for storage that is then bound to an available PersistentVolume.
Question
Which resource do you use to attach a volume in a Pod?
Options
- AStorageVolume
- BPersistentVolume
- CStorageClass
- DPersistentVolumeClaim
How the community answered
(30 responses)- B3% (1)
- C3% (1)
- D93% (28)
Why each option
To attach a volume to a Pod, you must reference a PersistentVolumeClaim (PVC) within the Pod's configuration. The PVC acts as a request for storage that is then bound to an available PersistentVolume.
StorageVolume is not a standard Kubernetes resource for attaching volumes to Pods; instead, PersistentVolumeClaim is used.
A PersistentVolume (PV) represents the actual piece of storage in the cluster, but Pods do not directly reference PVs; they request them via PVCs.
A StorageClass defines the 'classes' of storage available and how they are provisioned, but it is not directly used to attach a volume to a Pod.
A PersistentVolumeClaim (PVC) is a request for storage by a user, defined in the PodSpec. The Pod specifies a PVC, and Kubernetes ensures that the requested storage is provisioned and mounted into the Pod's filesystem.
Concept tested: Kubernetes PersistentVolumeClaim usage in Pods
Source: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims
Topics
Community Discussion
No community discussion yet for this question.