Welcome to the Linux Foundation Forum!
How to get pod CPU usage

Hello,
Anyone can help with a tip on how to get pods' CPU usage from node?
I thought I could use:
kubectl top pod podname
but I get the following error:
Error from server (NotFound): the server could not find the requested resource (get services http:heapster:)
I don't know anything about http:heapster:), is this something we should have installed and I miss it?
It supposed to be part of this class prerequisites?
Thank you in advance!
Stefan
1
Comments
Hi Stefan,
Heapster is a deprecated tool. You can take a look at the metrics-server instead:
https://github.com/kubernetes-sigs/metrics-server
Regards,
-Chris
Hello,
The metrics-server project is slowly being integrated into the API. You may be able to use the output of kubectl describe node to see the type of information you are looking for.
Regards,
Thank you Chris,
I can see CPU Requests, CPU Limits, Memory Requests, Memory Limits using kubectl describe node command.
But is there any way we can get the pod actual CPU usage without metrics-server?
Stefan
Hi Stefan,
Perhaps the documentation will be of some help:
https://kubernetes.io/docs/tasks/debug-application-cluster/resource-usage-monitoring/
Otherwise, the Linux top command provides such information, but on a per-process basis.
Regards,
-Chris