0
0
Kubernetesdevops~10 mins

Reclaim policies (Retain, Delete) in Kubernetes - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the reclaim policy to delete a PersistentVolume.

Kubernetes
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-example
spec:
  capacity:
    storage: 10Gi
  persistentVolumeReclaimPolicy: [1]
Drag options to blanks, or click blank then click option'
AKeep
BRetain
CRecycle
DDelete
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing Retain instead of Delete causes the volume to stay after release.
2fill in blank
medium

Complete the code to set the reclaim policy to retain a PersistentVolume after release.

Kubernetes
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-data
spec:
  capacity:
    storage: 5Gi
  persistentVolumeReclaimPolicy: [1]
Drag options to blanks, or click blank then click option'
ARetain
BRecycle
CDelete
DRemove
Attempts:
3 left
💡 Hint
Common Mistakes
Using Delete instead of Retain causes data loss.
3fill in blank
hard

Fix the error in the reclaim policy value to a valid option.

Kubernetes
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-fix
spec:
  capacity:
    storage: 8Gi
  persistentVolumeReclaimPolicy: [1]
Drag options to blanks, or click blank then click option'
ARemove
BDelete
CKeep
DRecycle
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid reclaim policies causes errors in Kubernetes.
4fill in blank
hard

Fill both blanks to create a PersistentVolume with Retain policy and 20Gi storage.

Kubernetes
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-retain
spec:
  capacity:
    storage: [1]
  persistentVolumeReclaimPolicy: [2]
Drag options to blanks, or click blank then click option'
ARetain
BDelete
C20Gi
D10Gi
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up storage sizes or reclaim policies.
5fill in blank
hard

Fill all three blanks to define a PersistentVolume with 15Gi storage, Delete reclaim policy, and name 'pv-delete'.

Kubernetes
apiVersion: v1
kind: PersistentVolume
metadata:
  name: [1]
spec:
  capacity:
    storage: [2]
  persistentVolumeReclaimPolicy: [3]
Drag options to blanks, or click blank then click option'
Apv-retain
B15Gi
CDelete
Dpv-delete
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong names or policies causes deployment issues.