Difficulty: Intermediate
Estimated Time: 5 minutes

image

Retain Reclaim Policy allows us the manual reclamation of any resource. We are going to implement OPA policy for the situation when we need to block the StorageClass containing the “Retain” as the Reclaim Policy.

In this scenario,we learned how to prevent the implementation of Reclaim Policy- Retain in the PersistentVolume.

To know more about this usecase - Denying Retain Reclaim Policy

For more OPA Gatekeeper use-cases do check - Master writeup of OPA Usecases

Deny " Retain" Reclaim" Policy

Step 1 of 4

Reason

The error message is printed on violation along with the name of the PersistentVolume used when on checking it returns “Retain” as the string in it leading the field becomes TRUE and our policy is violated.