<p>Is there any way to know that the number of pods have scaled up or down as a result of Horizontal Pod Autoscaling apart from kubectl get hpa command?</p>

<p>I want to trigger a particular file on every scale up or scale down of pods</p>

amankedia
<p>You can use status field of HPA to know when was last time HPA was executed.
Details about this can be found with below command:</p>

<pre><code>kubectl explain hpa.status
</code></pre>

<p>from this status , you can use lastScaleTime filed for your problem.</p>

<pre><code>lastScaleTime        &lt;string&gt;
 last time the HorizontalPodAutoscaler scaled the number of pods; used by
 the autoscaler to control how often the number of pods is changed.
</code></pre>
