--- 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