Complete the code to set the reclaim policy to delete a PersistentVolume.
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-example
spec:
capacity:
storage: 10Gi
persistentVolumeReclaimPolicy: [1]The Delete reclaim policy means the volume and its data are deleted when released.
Complete the code to set the reclaim policy to retain a PersistentVolume after release.
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-data
spec:
capacity:
storage: 5Gi
persistentVolumeReclaimPolicy: [1]The Retain policy keeps the volume and data after the claim is deleted.
Fix the error in the reclaim policy value to a valid option.
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-fix
spec:
capacity:
storage: 8Gi
persistentVolumeReclaimPolicy: [1]Only Delete and Retain are valid reclaim policies in Kubernetes v1. Recycle is deprecated and others are invalid.
Fill both blanks to create a PersistentVolume with Retain policy and 20Gi storage.
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-retain
spec:
capacity:
storage: [1]
persistentVolumeReclaimPolicy: [2]The storage size is set to 20Gi and the reclaim policy to Retain to keep the volume after release.
Fill all three blanks to define a PersistentVolume with 15Gi storage, Delete reclaim policy, and name 'pv-delete'.
apiVersion: v1 kind: PersistentVolume metadata: name: [1] spec: capacity: storage: [2] persistentVolumeReclaimPolicy: [3]
The volume is named pv-delete, has 15Gi storage, and uses the Delete reclaim policy.