Istio 101 : Circuit breaker for the pods


We have the below destination rule for routing traffic to the containerized application "application1" :


We create VirtualService so that all the traffic goes to our application "application1":


In the above VirtualService all traffic goes to "application1". The below DestinationRule has an effect on "application1" and all its traffic.

To avoid having lot of requests going to our pods and slowing down the application running inside, we set a circuit breaker that will stop requests when a pod is handling more than two requests at the same time - http1MaxPendingRequests -.

We can create a circuit breaker for our service using a destination rule as follows:


Above is the configuration file for a circuit breaker for any client applications making  a request to the "application1"  of the "svc1.ns1.svc.cluster.local" service. 

We are putting a cap on the number of connections and number of
pending requests to "2".

Below is a short explanation of some of the parameters used in the above Yaml file:
  • BaseEjectionTime : the maximum ejection duration for a host before getting taken into account again
  • ConsecutiveErrors : errors before a host is ignored from the loadbalancing pool.
  • Interval : the interval for looking into the ejected pod.
  • MaxEjectionPercent : percentage of hosts that can be ejected from the load balanced pool.

Comments

Popular posts from this blog

Istio 101 : How Istio ServiceEntry relates to Kubernetes Services and Endpoints

Kubernetes 101 : - Scaling a Stateful set -

Python 101 : Generators and Lists