<p>I am working on an STS based application and I want to temporarily disable HPA without deleting it. How can I achieve it?</p>
<p>I can't delete the HPA because if I delete it and again deploy the service then the HPA is created from STS and the name in STS and <code>hpa.yaml</code> is different. So, I don't want to delete it and I can't create using <code>hpa.yaml</code> using kubectl as per requirement.</p>
<p>So, is there any way I can disable and again enable it either using kubectl or make any changes to <code>hpa.yaml</code> file?</p>

beingumang
<p>I deleted and Created Again using the same name:</p>
<pre><code>kubectl autoscale statefulset &lt;sts_name&gt; --name=&lt;hpa_name_deleted&gt; --min=&lt;min_replica&gt; --max=&lt;max_replica&gt; --cpu-percent=&lt;cpu_percent&gt; --memory=&lt;target_memory&gt; -n &lt;namespace&gt;
</code></pre>
<p>I did not find any way to disable it temporarily.</p>
