apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
  name: route-via-egressgateway
  namespace: testns
spec:
  hosts:
    - egressgateway.bookinfo.com
  gateways:
  # Pinned to both the sidecars (mesh) and egress gateway
  - istio-egressgateway
  - mesh
  http:
    - match:
      - gateways:
        - mesh # from sidecars, route to egress gateway service
      route:
      - destination:
          host: istio-egressgateway
        weight: 100
    - match:
      - gateways: # from egress gateway, route to actual external service
                  # for testing purposes, we route to service t
        - istio-egressgateway
      route:
      - destination:
          host: eu.bookinfo.com
        weight: 100
