apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: helloworld-vs
spec:
  hosts:
    - "*"
  gateways:
    - helloworld-gateway
  http:
    - name: firefox
      match:
        - uri:
            exact: /helloworld
          headers:
            user-agent:
              regex: '.*Firefox.*'
      route:
        - destination:
            host: helloworld.default.svc.cluster.local
            port:
              number: 80
            subset: nginx
      rewrite:
        uri: "/"
    - name: curl
      match:
        - headers:
            user-agent:
              regex: '.*curl.*'
          uri:
            exact: /helloworld
      route:
        - destination:
            host: helloworld.default.svc.cluster.local
            port:
              number: 80
            subset: apache
      rewrite:
        uri: "/"
    - name: default
      match:
        - uri:
            exact: /helloworld
      route:
        - destination:
            host: helloworld.default.svc.cluster.local
            port:
              number: 80
            subset: default
      rewrite:
        uri: "/"