<p>I am new to Kubernetes, and planning on moving some of my ECS services to EKS. In my current auto-scaling algorithm, apart from CPU, memory and some other things I also used rate of incoming requests. In Kubernetes, how can I leverage rate of incoming requests to customize auto-scaling?</p>

<p>You can use the <strong>Prometheus</strong> adapter along with the HPA to scale the deployment based on incoming requests or other metrics you want.</p>
<p><a href="https://github.com/kubernetes-sigs/prometheus-adapter/blob/master/docs/walkthrough.md" rel="nofollow noreferrer">https://github.com/kubernetes-sigs/prometheus-adapter/blob/master/docs/walkthrough.md</a></p>
<p>also do check this out : <a href="https://github.com/zalando-incubator/kube-metrics-adapter" rel="nofollow noreferrer">https://github.com/zalando-incubator/kube-metrics-adapter</a></p>
<p><strong>Example</strong></p>
<pre><code>apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: myapp-hpa
  annotations:
    # metric-config.&lt;metricType&gt;.&lt;metricName&gt;.&lt;collectorType&gt;/&lt;configKey&gt;
    metric-config.pods.requests-per-second.json-path/json-key: &quot;$.http_server.rps&quot;
    metric-config.pods.requests-per-second.json-path/path: /metrics
    metric-config.pods.requests-per-second.json-path/port: &quot;9090&quot;
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: myapp
  minReplicas: 1
  maxReplicas: 10
  metrics:
  - type: Pods
    pods:
      metric:
        name: requests-per-second
      target:
        averageValue: 1k
        type: AverageValue
</code></pre>
