apiVersion : kyverno.io/v1
kind : ClusterPolicy
metadata :
  name: check-probe-intervals
spec:
  rules:
  - name: check-probe-intervals
    match:
      resources:
        kinds :
        - Deployment
    validate:
      message: "livenessProbe must be > 10s"
      pattern:
        spec:
          template:
            spec:
              containers:
                - name: "*"
                  livenessProbe:
                    periodSeconds: ">10"
  - name: check-probe-intervals
    match:
      resources:
        kinds :
        - Deployment
    validate:
      message: "readinessProbe must be > 10s"
      pattern:
        spec:
          template:
            spec:
              containers:
                - name: "*"
                  readinessProbe:
                    periodSeconds: ">10"
