mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-09 09:26:54 +00:00
30 lines
801 B
YAML
30 lines
801 B
YAML
apiVersion : kyverno.nirmata.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:
|
|
containers:
|
|
# In this case every object in containers list will be checked for pattern
|
|
- name: "*"
|
|
livenessProbe:
|
|
periodSeconds: "?"
|
|
- resource:
|
|
kinds:
|
|
- Deployment
|
|
name: check-readinessprobe-exists
|
|
validate:
|
|
message: "a readinessProbe is required"
|
|
pattern:
|
|
containers:
|
|
# In this case every object in containers list will be checked for pattern
|
|
- name: "*"
|
|
readinessProbe:
|
|
periodSeconds: "?"
|