Bird
0
0

You want to create a PersistentVolume that uses NFS storage with 50Gi capacity and allows multiple pods to read and write simultaneously. Which YAML snippet correctly defines this PV?

hard📝 Workflow Q8 of 15
Kubernetes - Persistent Storage
You want to create a PersistentVolume that uses NFS storage with 50Gi capacity and allows multiple pods to read and write simultaneously. Which YAML snippet correctly defines this PV?
AapiVersion: v1 kind: PersistentVolume metadata: name: pv-nfs spec: capacity: storage: 50Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Delete nfs: path: /exports server: 192.168.1.100
BapiVersion: v1 kind: PersistentVolume metadata: name: pv-nfs spec: capacity: storage: 50 accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain nfs: path: /exports server: 192.168.1.100
CapiVersion: v1 kind: PersistentVolumeClaim spec: resources: requests: storage: 50Gi accessModes: - ReadWriteMany
DapiVersion: v1 kind: PersistentVolume metadata: name: pv-nfs spec: capacity: storage: 50Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain nfs: path: /exports server: 192.168.1.100
Step-by-Step Solution
Solution:
  1. Step 1: Confirm kind and capacity format

    Kind must be PersistentVolume; capacity.storage must include unit '50Gi'.
  2. Step 2: Check accessModes and NFS config

    ReadWriteMany allows multiple pods; NFS server and path are correctly specified.
  3. Step 3: Identify errors in other options

    apiVersion: v1 kind: PersistentVolume metadata: name: pv-nfs spec: capacity: storage: 50Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Delete nfs: path: /exports server: 192.168.1.100 uses ReadWriteOnce; apiVersion: v1 kind: PersistentVolumeClaim spec: resources: requests: storage: 50Gi accessModes: - ReadWriteMany is a PVC, not PV; apiVersion: v1 kind: PersistentVolume metadata: name: pv-nfs spec: capacity: storage: 50 accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain nfs: path: /exports server: 192.168.1.100 misses unit in storage size.
  4. Final Answer:

    Correct NFS PV with 50Gi and ReadWriteMany -> Option D
  5. Quick Check:

    NFS PV with ReadWriteMany and unit Gi = B [OK]
Quick Trick: NFS PV needs ReadWriteMany and storage unit Gi [OK]
Common Mistakes:
  • Using PersistentVolumeClaim instead of PersistentVolume
  • Wrong accessModes for multi-pod write
  • Missing storage unit in capacity

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes