<p>I have created a horizontal auto-scaler based on the cpu usage and it works fine. I want to know how I can configure the autoscaler in a way that it just scales up without scaling down? The reason I want such a thing is when I have high load/request I create some operators but I want to keep them alive even if for some amount of time they don't do anything but auto-scaler kills the pods and scaling down to the minimum replicas after sometime if there is no load.</p>

<p>My autoscaler:</p>

<pre><code>apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: gateway
  namespace: default
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: gateway
  minReplicas: 1
  maxReplicas: 10
  targetCPUUtilizationPercentage: 20
</code></pre>

<p>Edit:
By operator, I mean small applications/programs that are running in a pod.</p>

AVarf
<p>You can add <code>--horizontal-pod-autoscaler-downscale-stabilization</code> flag to kube-controller-manager as described <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-cooldown-delay" rel="nofollow noreferrer">in docs</a>. Default delay is set to 5 minutes.</p>

<p>To add flag to kube-controller-manager edit <code>/etc/kubernetes/manifests/kube-controller-manager.yaml</code> on master node, pod will be then recreated.</p>
