---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: http-endpoint-gateway
  namespace: prd
spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: http-endpoint
  namespace: prd
spec:
  hosts:
  - "*"
  gateways:
  - http-endpoint-gateway
  http:
  - match:
    - uri:
        prefix: /test
    route:
    - destination:
        host: http-endpoint
#        subset: v1
        port:
          number: 8080
#  - match:
#    - headers:
#        cookie:
#          regex: "^(.*?;)?(user=jason)(;.*)?$"
#    - uri:
#        prefix: /test
#    route:
#    - destination:
#        host: http-endpoint
#        subset: v2
#        port:
#          number: 8080