apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: policy-gatekeeper-admission
spec:
remediationAction: inform # will be overridden by remediationAction in parent policy
severity: low
object-templates:
- complianceType: mustnothave
objectDefinition:
apiVersion: v1
kind: Event
metadata:
namespace: openshift-gatekeeper-system # set it to the actual namespace where gatekeeper is running if different
annotations:
constraint_action: deny
constraint_kind: K8sRequiredLabels
constraint_name: ns-must-have-gk
event_type: violation
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:name: policy-gatekeeper-admission
spec:remediationAction: inform # will be overridden by remediationAction in parent policyseverity: low
object-templates:-complianceType: mustnothave
objectDefinition:apiVersion: v1
kind: Event
metadata:namespace: openshift-gatekeeper-system # set it to the actual namespace where gatekeeper is running if differentannotations:constraint_action: deny
constraint_kind: K8sRequiredLabels
constraint_name: ns-must-have-gk
event_type: violation
Copy to ClipboardCopied!Toggle word wrapToggle overflow