apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  name: ingress-operator
  namespace: openshift-ingress-operator
  labels:
    role: alert-rules
  annotations:
    include.release.openshift.io/ibm-cloud-managed: "true"
    include.release.openshift.io/self-managed-high-availability: "true"
    include.release.openshift.io/single-node-developer: "true"
spec:
  groups:
    - name: openshift-ingress.rules
      rules:
      - alert: HAProxyReloadFail
        expr: template_router_reload_failure == 1
        for: 5m
        labels:
          severity: warning
        annotations:
          message: "HAProxy reloads are failing on {{ $labels.pod }}. Router is not respecting recently created or modified routes"
      - alert: HAProxyDown
        expr: haproxy_up == 0
        for: 5m
        labels:
          severity: critical
        annotations:
          message: "HAProxy metrics are reporting that HAProxy is down on pod {{ $labels.namespace }} / {{ $labels.pod }}"
      - alert: IngressControllerDegraded
        expr: ingress_controller_conditions{condition="Degraded"} == 1
        for: 5m
        labels:
          severity: warning
        annotations:
          message: |
            The {{ $labels.namespace }}/{{ $labels.name }} ingresscontroller is
            degraded: {{ $labels.reason }}.
      - alert: IngressControllerUnavailable
        expr: ingress_controller_conditions{condition="Available"} == 0
        for: 5m
        labels:
          severity: warning
        annotations:
          message: |
            The {{ $labels.namespace }}/{{ $labels.name }} ingresscontroller is
            unavailable: {{ $labels.reason }}.
