DEV Community

Maxime Guilbert
Maxime Guilbert

Posted on • Updated on

Istio - Default retry VirtualService configuration

During an Istio set-up on a new cluster, I don't know why and I don't find in the Istio documentation an explanation, but by default, VirtualServices that I created do a retry on an error 503.


Example of one VirtualService I use

apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: gateway
  namespace: development
spec:
  gateways:
  - development/ingressgw
  hosts:
  - gateway.dev.rtm.com
  http:
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        host: gateway.development.svc.cluster.local
        port:
          number: 443
Enter fullscreen mode Exit fullscreen mode

So if you don't want an automatic retry, you just have to add the following block in your object in the http list.

    retries:
      attempts: 0
Enter fullscreen mode Exit fullscreen mode

Complete correction

apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: gateway
  namespace: development
spec:
  gateways:
  - development/ingressgw
  hosts:
  - gateway.dev.rtm.com
  http:
  - match:
    - uri:
        prefix: /
    retries:
      attempts: 0
    route:
    - destination:
        host: gateway.development.svc.cluster.local
        port:
          number: 443
Enter fullscreen mode Exit fullscreen mode

If you have some information about that default config, please share it.

I hope it will help you in your istio configuration!


Please give me a feedback to help me to improve my writing skills. Thanks

Top comments (0)