<p>I am trying to get the stats of the containers that are running inside the kubernetes nodes via <strong>docker stats</strong> command. But unfortunately I am getting all the values as "0" for all the pod containers.</p>

<pre><code>CONTAINER     CPU %   MEM USAGE / LIMIT   MEM %   NET I/O     BLOCK I/O   PIDS
7dc5af9923b2  0.00%         0 B / 0 B     0.00%   0 B / 0 B   0 B / 0 B    0
</code></pre>

<p>I did the same with containers that I brought up manually via <strong>docker run</strong> command in the same node and I am getting proper values for those containers.</p>

<pre><code>CONTAINER     CPU %    MEM USAGE / LIMIT     MEM %    NET I/O       BLOCK I/O       PIDS
8be93c039a25  0.12%   133.3 MB / 3.892 GB    3.43%   0 B / 648 B  2.208 MB / 0 B     0
</code></pre>

<p>Is there any specific method to get the stats fot the pod containers other than this?</p>

<p>Note: docker version is 1.11.2 and kube version is 1.3.7</p>

<p>I resolved this one. I used the kubelet API to get the metrics for the node and well as for individual containers. The following API will return the metrics for a pod container.</p>

<pre><code>http://&lt;nodeIP&gt;:10255/stats/&lt;podName&gt;/&lt;containerName&gt; - POST
</code></pre>

<p><a href="https://stackoverflow.com/questions/35212008/kubernetes-how-to-get-disk-cpu-metrics-of-a-node/35212987#35212987">This post </a> that was suggested in the comments was much helpful. </p>

<p><a href="https://github.com/kubernetes/kubernetes/blob/release-1.1/pkg/kubelet/server.go#L971" rel="nofollow noreferrer">This</a> document has some more APIs to collect the metrics.</p>
