<p>I wish to understand co-relation between &quot;kubectl top pods&quot; output and linux command &quot;top&quot; executed inside POD.
How do they co-relate ?</p>
<p>While top shows current load/usage status along with 5-min &amp; 15-min details, do we have any such functionality for kubectl top pods command ?</p>
<p>Thanks in advance.</p>

Vijay Gharge
<p><a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#top" rel="nofollow noreferrer">Kubectl top</a> - Allows you to see the resource consumption for nodes or pods. This command requires Metrics Server to be correctly configured and working on the server.</p>
<p>The <strong>top</strong> command is used to show the Linux processes. It provides a dynamic real-time view of the running system</p>
<p>If you run top inside the pod, it will be like you run it on the host system because the pod is using the kernel of the host system. Unix top uses the proc virtual filesystem and reads /proc/meminfofile to get actual information about current memory status. Containers inside pods partially share /proc with the host system include a path about memory and CPU information.</p>
<p>For more  information refer to <a href="https://www.unixtutorial.org/commands/top" rel="nofollow noreferrer">top command in linux</a> and <a href="https://www.containiq.com/post/kubectl-top-pod-node-for-metrics" rel="nofollow noreferrer">Kubernetes Top pod/node</a> authored by Kasper Siig.</p>
