Varunkumar Manohar
Varunkumar Manohar

Reputation: 959

Autoscale pods based on http request count

I am looking for pointers on how to autoscale pods based on custom metrics.

As the number of incoming http requests increase, I would like my GKE pods to autoscale to handle the load.

What is the best way to achieve this ?

Upvotes: 2

Views: 3334

Answers (1)

Patrick W
Patrick W

Reputation: 4909

By default, HPA in GKE uses CPU to scale up and down (based on resource requests Vs actual usage). However, you can use custom metrics as well, just follow this guide. In your case, have the custom metric track the number of HTTP requests per pod (do not use the number of requests to the LB).

Make sure when using custom metrics, that the value you choose to use will be an average across all pods, this way the number will increase or decrease with the number of pods. If you choose a metric that is no affected by the number of pods you have, your HPA will either always be at the maximum or the minimum number of pods.

Upvotes: 1

Related Questions