<p>I have hpa configured for one of my deployment in Kubernetes.</p>

<p>Is there any way to check if HPA scaling happened to the deployment and when it happened?</p>

<p>I don't have prometheus or any monitoring solutions deployed.</p>

karthikeayan
<p>If you created HPA you can check current status using command</p>
<pre><code>$ kubectl get hpa
</code></pre>
<p>You can also use &quot;watch&quot; flag to refresh view each 30 seconds</p>
<pre><code>$ kubectl get hpa -w
</code></pre>
<p>To check if HPA worked you have to describe it</p>
<pre><code>$ kubectl describe hpa &lt;yourHpaName&gt;
</code></pre>
<p>Information will be in <code>Events:</code> section.</p>
<p>Also your deployment will contain some information about scaling</p>
<pre><code>$ kubectl describe deploy &lt;yourDeploymentName&gt;
...
Events:
  Type    Reason             Age    From                   Message
  ----    ------             ----   ----                   -------
  Normal  ScalingReplicaSet  11m    deployment-controller  Scaled up replica set php-apache-b5f58cc5f to 1
  Normal  ScalingReplicaSet  9m45s  deployment-controller  Scaled up replica set php-apache-b5f58cc5f to 4
  Normal  ScalingReplicaSet  9m30s  deployment-controller  Scaled up replica set php-apache-b5f58cc5f to 8
  Normal  ScalingReplicaSet  9m15s  deployment-controller  Scaled up replica set php-apache-b5f58cc5f to 10
</code></pre>
<p>Another way is use events</p>
<pre><code>$ kubectl get events | grep HorizontalPodAutoscaler
5m20s       Normal    SuccessfulRescale              HorizontalPodAutoscaler   New size: 4; reason: cpu resource utilization (percentage of request) above target
5m5s        Normal    SuccessfulRescale              HorizontalPodAutoscaler   New size: 8; reason: cpu resource utilization (percentage of request) above target
4m50s       Normal    SuccessfulRescale              HorizontalPodAutoscaler   New size: 10; reason:
</code></pre>
