In Kubernetes we've got HPA(Horizontal Pod Autoscaler) and CA(Cluster Autoscaler) that auto scale up and down based on request volume. If we adopt Istio's circuit breaker into Kubernetes, how do I adjust the maxConnections(http 1.1) accordingly due to auto scaling? Or do I need to do so? May be it is a bit contradictory as I want the auto scaling however I apply the circuit breaker to limit it. To me, I just want to protect my services from overprovisioned.
The maxConnections
will limit the amount of connections to a specific host. The default value is 1024. And it will not get affected by autoscaler
.
The maxConnections
from circuit breaker connection pool settings would be per envoy. So it would not be distributed across all pods, it would be per pod.
So by configuring MAXPODS
(maximum) amount of pods in Your HPA configuration. You can multiply by maxConnections
and You get maximum number of connections for the service.
So this configuration offers basic protecion against burst traffic and overprovisioning.
However if maxConnections
number is to low, pods might never get enough connections and start for example using higher cpu and triggering scaling.
There is an issue on github about this.
It is also possible to configure Prometheus metrics as triggers for Your HPA as described here.
Hope this helps.