<p>I have to turn off my service in production and turn it on again after a small period (doing a DB migration).</p>
<p>I know I can use <code>kubectl scale deployment mydeployment --replicas=0</code>. This services uses a HorizontalPodAutoscaler (HPA) so how would I go about reseting it to scale according to the HPA?</p>
<p>Thanks in advance :)</p>

Tebogo
<p>As suggested by the @ Gari Singh ,HPA will not scale from 0, so once you are ready to reactivate your deployment, just run kubectl scale deployment mydeployment --replicas=1 and HPA will then takeover again.</p>
<p>In Kubernetes, a HorizontalPodAutoscaler automatically updates a workload resource (such as a Deployment or StatefulSet), with the aim of automatically scaling the workload to match demand.</p>
<p>Horizontal scaling means that the response to increased load is to deploy more Pods. This is different from vertical scaling, which for Kubernetes would mean assigning more resources (for example: memory or CPU) to the Pods that are already running for the workload.</p>
<p>If the load decreases, and the number of Pods is above the configured minimum, the HorizontalPodAutoscaler instructs the workload resource (the Deployment, StatefulSet, or other similar resource) to scale back down.</p>
<p>Refer to this link on <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">Horizontal Pod Autoscaling</a> for detailed  more information</p>
