Load Balancing does not work after adding OutlierDetection

Behaviour: If i do not add outlierDetection detection in DestinationRule load balancing work as expected in round robin fashion, But if i add it then traffic is only forwarded to one pod only.

Version: 1.17.2
Destination rule.yml

apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: ui-tmp
spec:
  host: my-svc.default.svc.cluster.local
  trafficPolicy:
    #loadBalancer:
    #  simple: LEAST_REQUEST
    connectionPool:
      tcp:
        maxConnections: 50
      http:
        http2MaxRequests: 50
        maxRequestsPerConnection: 20
    #outlierDetection:
    #  consecutive5xxErrors: 10
    #  consecutiveGatewayErrors: 10
    #  interval: 30s
    #  baseEjectionTime: 2m
    #  maxEjectionPercent: 100

virual-service.yml

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: ui-tmp
spec:
  hosts:
  - "exmaple.com"
  gateways:
  - kg-istio-gateway
  http:
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        host: ui-tmp
        port:
          number: 80

gateway.yml

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: kg-istio-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"

If outlier detection is enabled, locality load balancer is enabled by default which only routes to local locality endpoints. If you do not want locality load balancing, you can disable by api/destination_rule.proto at 9242317ada7b437faf2167ade00da96ead04b83d · istio/api · GitHub

if i disable it , would my outlier detection still be working

You mean if you disable locality load balancer, would outlier detection work? Yes. It would work