1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 09:26:54 +00:00
kyverno/examples/Validate/check_probe_exists.yaml
2019-05-23 20:37:11 +03:00

36 lines
951 B
YAML

apiVersion : kyverno.io/v1alpha1
kind : Policy
metadata :
name: check-probe-exists
spec:
rules:
- name: check-liveness-probe-exists
resource:
kinds :
- StatefulSet
validate:
message: "a livenessProbe is required"
pattern:
spec:
template:
spec:
containers:
# In this case every object in containers list will be checked for pattern
- name: "*"
livenessProbe:
periodSeconds: ">0"
- name: check-readiness-probe-exists
resource:
kinds :
- StatefulSet
validate:
message: "a readinessProbe is required"
pattern:
spec:
template:
spec:
containers:
# In this case every object in containers list will be checked for pattern
- name: "*"
readinessProbe:
periodSeconds: ">0"