CKA · Question #41
Create a persistent volume with name app-data , of capacity 1Gi and access mode ReadOnlyMany. The type of volume is hostPath and its location is /srv/app-data .
This question tests your ability to create a Kubernetes PersistentVolume (PV) with specific storage characteristics using a hostPath backend. You must correctly configure the name, capacity, access mode, and hostPath location in a valid PV manifest.
Question
Explanation
This question tests your ability to create a Kubernetes PersistentVolume (PV) with specific storage characteristics using a hostPath backend. You must correctly configure the name, capacity, access mode, and hostPath location in a valid PV manifest.
Approach. Create a PersistentVolume manifest with apiVersion: v1, kind: PersistentVolume, metadata.name: app-data, spec.capacity.storage: 1Gi, spec.accessModes: [ReadOnlyMany], and spec.hostPath.path: /srv/app-data. Apply it with kubectl apply -f <file>.yaml or kubectl create -f <file>.yaml. The key details are: ReadOnlyMany (ROX) allows the volume to be mounted read-only by many nodes simultaneously, and hostPath binds the PV directly to a directory on the node's filesystem. No StorageClass is required unless specified.
Concept tested. Kubernetes PersistentVolume creation - understanding PV spec fields: capacity, accessModes (ReadWriteOnce vs ReadOnlyMany vs ReadWriteMany), volume types (hostPath, nfs, etc.), and how to apply resource manifests with kubectl.
Reference. https://kubernetes.io/docs/concepts/storage/persistent-volumes/
Topics
Community Discussion
No community discussion yet for this question.