Bug 1918785

Summary: Pod request and limit calculations in console are incorrect
Product: OpenShift Container Platform Reporter: Clayton Coleman <ccoleman>
Component: Management ConsoleAssignee: Clayton Coleman <ccoleman>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.7CC: aos-bugs, dkulkarn, jokerman, spadgett, yapei
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Fixes an issue where the web console calculated pod requests and limits inaccurately in memory and CPU charts on the project dashboard and pod details pages. Completed pods were not excluded, init containers were not included, and overhead wasn't calculated.
Story Points: ---
Clone Of:
: 1974686 (view as bug list) Environment:
Last Closed: 2021-07-27 22:36:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1974686, 1975147    
Attachments:
Description Flags
01 - no request line
none
pod CPU/Memory requests/limits
none
project CPU/Memory requests none

Description Clayton Coleman 2021-01-21 14:44:42 UTC
Our previous metrics were inadequate for calculating pod request and limits - completed pods were supposed to be excluded, init containers were not included, and overhead wasn't calculated. Starting with 4.7 we now have a Kube metric that calculates this correctly from the scheduler - kube_pod_resource_request and kube_pod_resource_limit - and the console can use them quite easily.

Update the console with the new metrics.

Comment 2 Yadan Pei 2021-01-26 09:13:57 UTC
https://github.com/openshift/console/pull/7894 fix PR

Comment 3 Yadan Pei 2021-01-26 09:26:11 UTC
Created attachment 1750838 [details]
01 - no request line

# oc get pods console-664f87d4f-f99fq  -n openshift-console -o json | jq '.spec.containers[0].resources.requests'
{
  "cpu": "10m",
  "memory": "100Mi"
}

On a cluster with PR fix, CPU/Memory Usage charts doesn't show the request line(orange dotted line), see attachment 01 [details] - no request line.

Assigning back for double confirmation

Comment 4 Samuel Padgett 2021-02-05 18:26:56 UTC
I see this as well for the console pod. Assigning back to Clayton. Clayton, let us know if you'd like someone on the console team to investigate.

Comment 9 Yadan Pei 2021-04-15 07:53:58 UTC
Created attachment 1772080 [details]
pod CPU/Memory requests/limits

Comment 10 Yadan Pei 2021-04-15 07:57:22 UTC
Created attachment 1772081 [details]
project CPU/Memory requests

Comment 11 Yadan Pei 2021-04-15 07:59:00 UTC
Pod CPU/Memory requests/limits is shown correctly, see attachment 'pod CPU/Memory requests/limits' 
Project CPU/Memory requests is shown correctly, see attachment 'project CPU/Memory requests'


Verified on 4.8.0-0.nightly-2021-04-13-171608

Comment 14 errata-xmlrpc 2021-07-27 22:36:39 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 (Moderate: OpenShift Container Platform 4.8.2 bug fix and security 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-2021:2438