<p>I am using <code>Kubernetes</code> in <code>GCP</code>. I am scaling my pods using metrics of queue size uploaded to Cloud Monitoring.</p>

<p>The problem:
Kubernetes scale up pods in very short intervals. About 12-15 seconds between each scale up. My machines take about 30 seconds to boot up. I would like the scale up intervals to be something close to 30.</p>

<p>Adding </p>

<p><code>spec:
  minReadySeconds: 30</code></p>

<p>to the deployment yaml did not worked.</p>

<p>Example hpa:</p>

<pre><code>apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: &lt;NAME&gt;
  namespace: &lt;NAMESPACE&gt;
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: &lt;DEPLOYMENT&gt;
  minReplicas: &lt;MIN_REPLICAS&gt;
  maxReplicas: &lt;MAX_REPLICAS&gt;
  metrics:
  - type: External
    external:
      metricName: "custom.googleapis.com|rabbit_mq|&lt;QUEUE&gt;|messages_count"
      metricSelector:
        matchLabels:
          metric.labels.name: &lt;NAMESPACE&gt;
      targetValue: &lt;TARGETVALUE&gt;
</code></pre>

<p>Is there a way to control this scale-up interval?</p>

Montoya
<p>The delays between scale-ups are determined internally by the HPA algorithm.</p>

<p>From the <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-cooldown-delay" rel="nofollow noreferrer">documentation</a>:</p>

<blockquote>
  <p>Starting from v1.12, a new algorithmic update removes the need for the upscale delay.</p>
</blockquote>

<p>It seems it was a configurable parameter before, but now the algorithm tries to be smart about it and decide on its own how quickly to scale up your app.</p>

<p>To be really sure how the HPA does it and how you could influence it, you can <a href="https://github.com/kubernetes/kubernetes/tree/master/pkg/controller/podautoscaler" rel="nofollow noreferrer">inspect the code</a>.</p>
