---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  creationTimestamp: "2025-10-29T11:52:47Z"
  generation: 1
  labels:
    app: kubevirt-hyperconverged
    app.kubernetes.io/component: monitoring
    app.kubernetes.io/managed-by: hco-operator
    app.kubernetes.io/part-of: hyperconverged-cluster
    app.kubernetes.io/version: 4.19.11
  managedFields:
  - apiVersion: monitoring.coreos.com/v1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:labels:
          .: {}
          f:app: {}
          f:app.kubernetes.io/component: {}
          f:app.kubernetes.io/managed-by: {}
          f:app.kubernetes.io/part-of: {}
          f:app.kubernetes.io/version: {}
        f:ownerReferences:
          .: {}
          k:{"uid":"dbceb915-8326-4fe5-abfa-39d66ac9f16e"}: {}
      f:spec:
        .: {}
        f:groups:
          .: {}
          k:{"name":"alerts.rules"}:
            .: {}
            f:name: {}
            f:rules: {}
    manager: hyperconverged-cluster-operator
    operation: Update
    time: "2025-10-29T11:52:47Z"
  name: kubevirt-cnv-prometheus-rules
  namespace: openshift-cnv
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: false
    controller: false
    kind: Deployment
    name: hco-operator
    uid: dbceb915-8326-4fe5-abfa-39d66ac9f16e
  resourceVersion: "2143413"
  uid: 21f7e8fa-3fa5-4583-b505-34494d9b9bac
spec:
  groups:
  - name: alerts.rules
    rules:
    - alert: HAControlPlaneDown
      annotations:
        description: Control plane node {{ $labels.node }} has been not ready for
          more than 5 minutes.
        runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/openshift-virtualization-operator/HAControlPlaneDown.md
        summary: Control plane node {{ $labels.node }} is not ready
      expr: kube_node_role{role='control-plane'} * on(node) kube_node_status_condition{condition='Ready',status='true'}
        == 0
      for: 5m
      labels:
        kubernetes_operator_component: cnv-observability
        kubernetes_operator_part_of: kubevirt
        operator_health_impact: none
        severity: critical
    - alert: HighCPUWorkload
      annotations:
        description: CPU utilization for {{ $labels.instance }} has been above 90%
          for more than 5 minutes.
        runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/openshift-virtualization-operator/HighCPUWorkload.md
        summary: High CPU usage on host {{ $labels.instance }}
      expr: instance:node_cpu_utilisation:rate1m >= 0.9
      for: 5m
      labels:
        kubernetes_operator_component: cnv-observability
        kubernetes_operator_part_of: kubevirt
        operator_health_impact: none
        severity: warning
    - alert: NodeNetworkInterfaceDown
      annotations:
        description: '{{ $value }} network devices have been down on instance {{ $labels.instance
          }} for more than 5 minutes.'
        runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/openshift-virtualization-operator/NodeNetworkInterfaceDown.md
        summary: Network interfaces are down
      expr: "count by (instance) (\n\t\t\t\t\t(node_network_flags % 2) >= 1\t\t\t\t\t\t\t\t\t\t\t#
        IFF_UP is set\n\t\t\t\t\tand\n\t\t\t\t\t(node_network_flags % 128) < 64\t\t\t\t\t\t\t\t\t\t\t#
        IFF_RUNNING is NOT set\n\t\t\t\t\tand\n\t\t\t\t\t(node_network_flags % 131072)
        < 65536\t\t\t\t\t\t\t\t\t\t    # IFF_LOWER_UP is NOT set\n\t\t\t\t\tand\n\t\t\t\t\ton(instance,device)
        node_network_up == 1\t\t\t\t\t\t\t\t\t        # Interface is up\n\t\t\t\t\tand\n\t\t\t\t\ton(instance,device)
        node_network_carrier == 1                                    # Interface carrier
        is up\n\t\t\t\t\tand\n\t\t\t\t\ton(instance,device) (node_network_flags unless
        node_network_flags{device=~\"lo|tunbr|veth.+|ovs-system|genev_sys.+|br-int\"})
        \    # Excluding ignored interfaces\n\t\t\t\t) > 0"
      for: 5m
      labels:
        kubernetes_operator_component: cnv-observability
        kubernetes_operator_part_of: kubevirt
        operator_health_impact: none
        severity: warning
