redhat-cop / openshift-toolkit

A collection of code samples to help you get started with OpenShift
Apache License 2.0
232 stars 150 forks source link

[K8s/Compute Resources/Cluster Grafana Dashboard] CPU Quota is pulling in terminated pods in the CPU Limits count #103

Open clutchbeyers opened 5 years ago

clutchbeyers commented 5 years ago

I noticed some skewed numbers in some of our projects for the CPU Quota. The calculations are factoring in 0/1 Completed pods as well as active running, I dont think that is the intent with these numbers.

Example CPU Quota Numbers Namespace CPU Usage CPU Reqeusts CPU Req % CPU Limitis CPU Limits % example-project | 0.01 | 2.70 | 0.25% | 108.00 | 0.01%

Requests/Limits Per Pod Limits: cpu: 2 memory: 3Gi Requests: cpu: 50m memory: 256Mi

There was 1 Running 1/1 Pod, the other 53 were build pods that were in 0/1 Completed state

54x2 limit per pod = 108.00 CPU limits

It seems like these numbers should filter out Completed/Failed non-running pods in a project for accurate utilization reporting??