Complete the code to define the API version for a PersistentVolume.
apiVersion: [1]
kind: PersistentVolume
metadata:
name: pv-exampleThe correct API version for PersistentVolume is v1.
Complete the code to specify the PersistentVolume capacity.
spec:
capacity:
storage: [1]The storage capacity must be specified with a unit like Gi for gibibytes.
Fix the error in the PersistentVolume access mode specification.
spec:
accessModes:
- [1]The valid access modes include ReadWriteOnce, ReadOnlyMany, and ReadWriteMany. ReadWriteOnce is commonly used.
Fill both blanks to define the PersistentVolume host path and reclaim policy.
spec:
hostPath:
path: [1]
persistentVolumeReclaimPolicy: [2]The hostPath should point to a valid directory like /mnt/data. The reclaim policy Retain keeps the data after the volume is released.
Fill all three blanks to complete the PersistentVolume spec with storage class, volume mode, and capacity.
spec: storageClassName: [1] volumeMode: [2] capacity: storage: [3]
The storageClassName is a user-defined class like fast-storage. The volumeMode can be Filesystem or Block. The capacity must include a unit like 20Gi.