<p>So, I'm having an unexpectedly hard time figuring this out.  I have a kubernetes cluster deployed in AKS.  In Azure (or Kubernetes dashboard), How do I view how many active pods there were in a given time frame?</p>

chuckw87
<p><strong>Updated 0106</strong>:</p>
<p>You can use the query below to count the number of active pods:</p>
<pre><code>KubePodInventory 
| where TimeGenerated &gt; ago(2d)//set the time frame to 2 days
| where PodStatus == &quot;Running&quot;
| project PodStatus
| summarize count() by PodStatus
</code></pre>
<p>Here is the test result:</p>
<p><a href="https://i.stack.imgur.com/9YUiu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9YUiu.jpg" alt="enter image description here" /></a></p>
<hr />
<p><strong>Original answer:</strong></p>
<p>If you have configured monitoring, then you can use kusto query to fetch it.</p>
<p>Steps as below:</p>
<p>1.Go to azure portal -&gt; your AKS.</p>
<p>2.In the left panel -&gt; Monitoring -&gt; click Logs.</p>
<p>3.In the table named <code>KubePodInventory</code>, there is a field <code>PodStatus</code> which you can use it as filter in your query. You can write your own kusto query and specify the <code>Time range</code> via portal(by clicking the <code>Time range</code> button) or in query(by using <a href="https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/agofunction" rel="nofollow noreferrer">ago()</a> function). You should also use the <a href="https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/count-aggfunction" rel="nofollow noreferrer">count()</a> function to count the number.</p>
<p><a href="https://i.stack.imgur.com/b6QK6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b6QK6.jpg" alt="enter image description here" /></a></p>
