Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between kubectl top and kube-capacity Plug-In --util values #16

Closed
VF-mbrauer opened this issue May 20, 2019 · 3 comments
Closed

Comments

@VF-mbrauer
Copy link

When using the following command:

~$ kubectl top nodes

NAME                                          CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
ip-10-1-0-100.eu-central-1.compute.internal   589m         7%     12429Mi         81%     

there is a difference in the utilization:

~$ kubectl resource-capacity --util --sort cpu.util | sed -r '/^\s*$/d'
NODE                                          CPU REQUESTS    CPU LIMITS       CPU UTIL       MEMORY REQUESTS   MEMORY LIMITS     MEMORY UTIL
ip-10-1-0-100.eu-central-1.compute.internal   6245m (78%)     9400m (117%)     346m (4%)      13177Mi (86%)     18224Mi (119%)    10593Mi (69%)

Why is that the case? Is this a bug, or do we need to take anything else into consideration?
Thanks.

@robscott
Copy link
Owner

robscott commented Jun 8, 2019

Hey @VF-mbrauer, that's a great question. It looks like kubectl top is using node metrics there (which makes sense), where I'm using the sum of pod metrics to get a node total. The difference seems to be any system utilization happening on a node that isn't represented as part of a pod. I think it would likely make sense to update my logic to also fetch node metrics, instead of summing all the pods like I currently am. I don't have a ton of extra time right now, but will try to fit this in when I do.

@robscott
Copy link
Owner

Hey @VF-mbrauer, I've published a new 0.3.2 release that should fix this. Let me know if you run into any issues with it. Thanks for reporting this!

@VF-mbrauer
Copy link
Author

Thanks a lot @robscott. Will do and let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants