<p>I want to use kind other than Deployment for Autoscaling in Kubernetes is it possible ? the reason I don't want to use kind:Deployment is the restart policy, as per as k8s documentation the only valid field for restart policy is &quot;Always&quot;, and If put &quot;Never&quot; I am getting an error.</p>
<p>In my scenario I have a external monitoring UI which I use to shutdown the service if required, but now what happening is the pods are terminating and new pod are getting created. What should I do ? please note that I can not run it as kind:Pod as I want to auto-scale the services and Autoscaling of Kind:Pod is not valid !</p>
<p>Please share your suggestions and view on this ! thanks in advance.</p>

<p>HPA can be used with the following resources: <code>ReplicationController</code>, <code>Deployment</code>, <code>ReplicaSet</code> or <code>StatefulSet</code>. However HPA doesn't support scaling to 0.</p>
<p>There are some serverless frameworks that support scalability to zero in kubernetes such as <a href="https://knative.dev/" rel="nofollow noreferrer">Knative</a> and <a href="https://keda.sh/" rel="nofollow noreferrer">Keda</a>.</p>
<p>Your use case sounds much simpler though, as you're looking to scale to zero based on a manual action. You can achieve this by setting the number of replicas of your deployment to 0.</p>
<pre><code>kubectl scale --replicas=0 deployment/{deploymentName}
</code></pre>
<p>And then if you want to re-activate the service then increase the replicas back again.</p>
<pre><code>kubectl scale --replicas=1 deployment/{deploymentName}
</code></pre>
