# Generic read-only demonstration, not a deployed workload profile.
# The application makes ONE explicit call; this mesh route owns retries.
# Requires a matching, visible HTTP route and a real catalog Service.
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
  name: catalog-read-budget
  namespace: demo
spec:
  hosts:
    - catalog.demo.svc.cluster.local
  gateways:
    - mesh
  http:
    - name: retry-safe-catalog-read
      match:
        - method:
            exact: GET
          uri:
            prefix: /api/catalog/
      timeout: 3s              # Total proxy route budget; includes proxy retries.
      retries:
        attempts: 2            # Two retries, so at most three upstream attempts.
        perTryTimeout: 800ms   # Initial upstream attempt and each retry.
        retryOn: connect-failure,refused-stream,gateway-error
      route:
        - destination:
            host: catalog.demo.svc.cluster.local
            port:
              number: 8080
