1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 18:06:55 +00:00
kyverno/test/policy/validate/check_probe_exists.yaml

43 lines
905 B
YAML
Raw Normal View History

---
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
2019-10-14 12:36:19 -07:00
name: check-probe-exists
spec:
admission: true
background: true
2019-10-14 12:36:19 -07:00
rules:
- match:
any:
- resources:
kinds:
- StatefulSet
name: check-liveness-probe-exists
2019-10-14 12:36:19 -07:00
validate:
message: a livenessProbe is required
2019-10-14 12:36:19 -07:00
pattern:
spec:
template:
spec:
containers:
- livenessProbe:
periodSeconds: '>0'
name: '*'
- match:
any:
- resources:
kinds:
- StatefulSet
name: check-readiness-probe-exists
2019-10-14 12:36:19 -07:00
validate:
message: a readinessProbe is required
2019-10-14 12:36:19 -07:00
pattern:
spec:
template:
spec:
containers:
- name: '*'
2019-10-14 12:36:19 -07:00
readinessProbe:
periodSeconds: '>0'
validationFailureAction: Audit