Challenge - 5 Problems
PersistentVolume Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of kubectl get pv command
You have created a PersistentVolume (PV) in Kubernetes with the following YAML. What will be the output of
kubectl get pv after applying this configuration?Kubernetes
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-example
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
hostPath:
path: /mnt/dataAttempts:
2 left
💡 Hint
Check the
persistentVolumeReclaimPolicy and status fields after creation.✗ Incorrect
When a PV is created but not yet claimed by any PersistentVolumeClaim, its status is 'Available'. The reclaim policy is 'Retain' as specified. Access mode is ReadWriteOnce (RWO).
🧠 Conceptual
intermediate1:30remaining
Understanding PersistentVolume reclaim policies
Which reclaim policy for a PersistentVolume causes the volume to be deleted automatically when the PersistentVolumeClaim is deleted?
Attempts:
2 left
💡 Hint
Think about what happens to the storage after the claim is removed.
✗ Incorrect
The 'Delete' reclaim policy deletes the underlying storage resource when the PersistentVolumeClaim is deleted. 'Retain' keeps the data, and 'Recycle' is deprecated.
❓ Configuration
advanced2:30remaining
Correct PersistentVolume YAML for NFS storage
Which of the following PersistentVolume YAML snippets correctly defines a PV using NFS storage with 10Gi capacity and ReadWriteMany access mode?
Attempts:
2 left
💡 Hint
Check the access mode and the storage type fields carefully.
✗ Incorrect
Option B correctly uses 'nfs' with both 'server' and 'path' fields, sets capacity to 10Gi, and access mode to ReadWriteMany. Option B uses ReadWriteOnce which is less common for NFS. Option B uses hostPath instead of nfs. Option B misses the 'path' field under nfs.
❓ Troubleshoot
advanced2:00remaining
Troubleshooting PV binding failure
A PersistentVolumeClaim (PVC) requesting 20Gi with access mode ReadWriteOnce is stuck in Pending state. The cluster has a PV with 10Gi capacity and access mode ReadWriteOnce. What is the most likely reason the PVC is not binding?
Attempts:
2 left
💡 Hint
Check if the PV can satisfy the PVC size requirement.
✗ Incorrect
PVCs can only bind to PVs that have equal or greater capacity than requested. Here, the PV has only 10Gi but PVC requests 20Gi, so binding fails.
✅ Best Practice
expert1:30remaining
Best practice for PersistentVolume naming and labels
Which of the following is the best practice when defining PersistentVolumes in a production Kubernetes cluster to facilitate management and selection by PersistentVolumeClaims?
Attempts:
2 left
💡 Hint
Think about how labels help in selecting PVs for PVCs.
✗ Incorrect
Using descriptive names and meaningful labels (like storage type, environment) helps administrators and PVCs select appropriate PVs easily. Random or numeric names and lack of labels reduce clarity and management ease.