mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-09 01:16:55 +00:00
26 lines
676 B
YAML
26 lines
676 B
YAML
|
apiVersion : kyverno.io/v1alpha1
|
||
|
kind : Policy
|
||
|
metadata :
|
||
|
name : validation-example2
|
||
|
spec :
|
||
|
rules:
|
||
|
- name: check-memory_requests_link_in_yaml
|
||
|
resource:
|
||
|
# Kind specifies one or more resource types to match
|
||
|
kinds:
|
||
|
- Deployment
|
||
|
# Name is optional and can use wildcards
|
||
|
name: "*"
|
||
|
# Selector is optional
|
||
|
selector:
|
||
|
validate:
|
||
|
pattern:
|
||
|
spec:
|
||
|
containers:
|
||
|
- name: "*"
|
||
|
resources:
|
||
|
requests:
|
||
|
memory: "$(<=/spec/containers/0/resources/limits/memory)"
|
||
|
limits:
|
||
|
memory: "2048Mi"
|