1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/test/ResourceQuota/policy-quota-validation.yaml
2019-07-25 14:57:44 -04:00

48 lines
1 KiB
YAML

apiVersion : kyverno.io/v1alpha1
kind : Policy
metadata :
name : policy-quota-low-test-validation
spec :
rules:
- name: "rule1"
match:
resources:
kinds :
- ResourceQuota
selector:
matchLabels:
quota: low
validate:
message: "This RQ requests too many RAM"
pattern:
spec:
hard:
memory: "8Gi|12Gi"
- name: "rule2"
match:
resources:
kinds :
- ResourceQuota
selector:
matchLabels:
quota: low
validate:
message: "This RQ requests too many CPUs"
pattern:
spec:
hard:
cpu: <3
- name: "rule3"
match:
resources:
kinds :
- ResourceQuota
selector:
matchLabels:
quota: low
validate:
message: "This RQ requests too many PODs"
pattern:
spec:
hard:
pods: 1|2|3|4