Discrepancy between the result of "kubectl top nodes" Memory Utilization compared to the total memory utilization of "kubectl top pods" deployed under the corresponding nodes

Poojari, Vinaya (Cognizant) 0 Reputation points
2023-07-19T09:31:54.9066667+00:00

when we execute, kubectl top nodes ,we can see below output

for eg:

         Memory-Utilization

node1 60%

node2 79%

but if we verify the sum of the Memory Utilization(%) for all the pods deployed inside the node2 using kubectl top pods then it doesn't match 79% instead the sum would be very less for eg: 45%.

We would like to understand where are the extra utilization is being consumed and how to check that.

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,447 questions
{count} votes

1 answer

Sort by: Most helpful
  1. kobulloc-MSFT 26,801 Reputation points Microsoft Employee Moderator
    2023-07-19T17:12:01.06+00:00

    Hello, @Poojari, Vinaya (Cognizant) !

    Why doesn't the memory usage shown for kubectl top nodes match the memory usage shown for all of the pods in kubectl top pods?

    Executing kubectl top nodes includes not only the memory used by the pods but also the memory used by the Kubernetes components and system processes running on the node while kubectl top pods returns all the memory used by the pod.

    Additional reading:


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.