Bug 2210554 - KubeVirtComponentExceedsRequestedCPU alert not firing
Summary: KubeVirtComponentExceedsRequestedCPU alert not firing
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Metrics
Version: 4.13.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 4.14.0
Assignee: João Vilaça
QA Contact: Ahmad
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-28 13:49 UTC by Ohad
Modified: 2023-11-08 14:06 UTC (History)
3 users (show)

Fixed In Version: hco-bundle-registry-container-v4.14.0.rhel9-826
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-08 14:05:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt kubevirt pull 9853 0 None Merged [release-0.59] Remove mixin query not available on all clusters 2023-06-06 12:32:16 UTC
Red Hat Issue Tracker CNV-29218 0 None None None 2023-05-28 13:51:28 UTC
Red Hat Product Errata RHSA-2023:6817 0 None None None 2023-11-08 14:06:05 UTC

Description Ohad 2023-05-28 13:49:57 UTC
Description of problem:
This alert should not fired, the metric for that doesn't catch when the conditions are met.

How reproducible:
Reduce the cpu request.

Steps to Reproduce:
1.scale down virt-operator
oc -n openshift-cnv scale deployment virt-operator --repilicas=0
2.Modify the cpu requested from one of the virt-components:
oc -n openshift-cnv patch deployment virt-controller -p '{"spec": {"template": {"spec": {"containers": [{"name": "virt-controller", "resources": {"requests": {"cpu": "2Mi"}}}]}}}}'
3.Run the metric: 
((kube_pod_container_resource_requests{container=~"virt-controller|virt-api|virt-handler|virt-operator",namespace="openshift-cnv",resource="cpu"}) - on (pod) group_left (node) node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate{namespace="openshift-cnv"}) < 0

Actual results:
No datapoints found

Expected results:
The metric should fire the alert.

Additional info:
scale up again the virt-operator for reconciliation.
There is a similar alert just for the memory : KubeVirtComponentExceedsRequestedMemory, this alert is fired and works when reducing the memory in the same way reducing the cpu for the alert above.

Comment 1 Ahmad 2023-06-13 13:28:58 UTC
QA: Fixed verified v4.14
Fixed In Version: hco-bundle-registry-container-v4.14.0.rhel9-826



[cloud-user@ocp-psi-executor ~]$ oc exec -n openshift-monitoring prometheus-k8s-0 -c prometheus -- curl -s http://127.0.0.1:9090/api/v1/alerts | jq . | grep "Exceed"
[cloud-user@ocp-psi-executor ~]$ 
[cloud-user@ocp-psi-executor ~]$ oc -n openshift-cnv scale deployment virt-operator --replicas=0
deployment.apps/virt-operator scaled
[cloud-user@ocp-psi-executor ~]$ oc -n openshift-cnv patch deployment virt-controller -p '{"spec": {"template": {"spec": {"containers": [{"name": "virt-controller", "resources": {"requests": {"memory": "0Mi"}}}]}}}}'
deployment.apps/virt-controller patched (no change)
[cloud-user@ocp-psi-executor ~]$ oc exec -n openshift-monitoring prometheus-k8s-0 -c prometheus -- curl -s http://127.0.0.1:9090/api/v1/alerts | jq . | grep "Exceed"
          "alertname": "KubeVirtComponentExceedsRequestedMemory",
          "runbook_url": "https://docs.openshift.com/container-platform/4.14/virt/support/virt-runbooks.html#virt-runbook-KubeVirtComponentExceedsRequestedMemory",
          "alertname": "KubeVirtComponentExceedsRequestedMemory",
          "runbook_url": "https://docs.openshift.com/container-platform/4.14/virt/support/virt-runbooks.html#virt-runbook-KubeVirtComponentExceedsRequestedMemory",

Comment 3 errata-xmlrpc 2023-11-08 14:05:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Virtualization 4.14.0 Images security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6817


Note You need to log in before you can comment on or make changes to this bug.