1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/test/policy/validate/check_probe_exists.yaml
Charles-Edouard Brétéché 6a43ec4bcf
chore: fix policies (#8449)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-19 10:28:58 +00:00

42 lines
905 B
YAML

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