title: Horizontal pod Autoscaler scales custom metric too aggressively on GKE
body: <p>I have the below Horizontal Pod Autoscaller configuration on Google Kubernetes Engine to scale a deployment by a custom metric - <code>RabbitMQ messages ready count</code> for a specific queue: <code>foo-queue</code>.</p>
  <p>It picks up the metric value correctly.</p>
  <p>When inserting 2 messages it scales the deployment to the maximum 10 replicas.
  I expect it to scale to 2 replicas since the targetValue is 1 and there are 2 messages ready.</p>
  <p>Why does it scale so aggressively?</p>
  <p>HPA configuration:</p>
  <pre><code>apiVersion: autoscaling/v2beta1
  kind: HorizontalPodAutoscaler
  metadata:
    name: foo-hpa
    namespace: development
  spec:
    scaleTargetRef:
      apiVersion: apps/v1
      kind: Deployment
      name: foo
    minReplicas: 1
    maxReplicas: 10
    metrics:
    - type: External
      external:
        metricName: &quot;custom.googleapis.com|rabbitmq_queue_messages_ready&quot;
        metricSelector:
          matchLabels:
            metric.labels.queue: foo-queue
        targetValue: 1
  </code></pre>