Why isn't the circuit breaking of ISTIO working?

8/9/2021
  • with istio 1.4.6

I configured Kubernetes using resources such as service, deployment. I also configured gateway, virtual service, and destination rules to implement circuit breakers.

The composition diagram is as follows. (number of Pod's replica is two. & I operate only one version of app.)

enter image description here

I wrote VirtualServices and DestinationRules to use circuit breakers

VirtualService

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: reviews-virtual-service
spec:
  gateways:
  - reviews-istio-gateway
  hosts:
  - reviews
  http:
  - route:
    - destination:
        host: reviews-service
        port:
          number: 80

DestinationRules

apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: reviews-destination-rule
spec:
  host: reviews
  trafficPolicy:
    loadBalancer:
      simple: ROUND_ROBIN
    outlierDetection:
      baseEjectionTime: 1m
      consecutiveErrors: 1
      interval: 1s
      maxEjectionPercent: 100

Here, I expect that if more than one error occurs in reviews-app, all pods will be excluded from the load balancing list for a minute. Therefore, I expected the circuit breaking to work as below.

enter image description here

However, contrary to expectations, circuit breakers did not work, and error logs were continuously being recorded in reviews-app.

Why isn't the circuit breaker working?

-- henry-jo
circuit-breaker
istio
kubernetes

1 Answer

8/10/2021

I guess the problem is not about Circuit Breaking, but about the usage of Virtual Services and Destination Rules.

For example, if using a Virtual Service with a Gateway, its host should probably be of public host, like http://amce.io

The host of the Destination Rule should probably be that of the Kubernetes Service.

-- user140547
Source: StackOverflow