apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: helloworld-foo
  namespace: foo
spec:
  hosts:
    - "*"
  gateways:
    - default/helloworld-gateway
  http:
    - match:
        - uri:
            exact: /helloworld
      route:
        - destination:
            host: helloworld.default.svc.cluster.local
            port:
              number: 80
      rewrite:
        uri: "/"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: helloworld-default
  namespace: default
spec:
  hosts:
    - "*"
  gateways:
    - default/helloworld-gateway
  http:
    - match:
        - uri:
            exact: /failure
      route:
        - destination:
            host: helloworld.default.svc.cluster.local
            port:
              number: 80
      rewrite:
        uri: "/"