apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: podinfo
  namespace: test
spec:
  gateways:
    - public-gateway.istio-system.svc.cluster.local
    - mesh
  hosts:
    - podinfo.istio.weavedx.com
    - podinfo
  http:
    - route:
        - destination:
            host: podinfo
            subset: primary
          weight: 50
        - destination:
            host: podinfo
            subset: canary
          weight: 50
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: podinfo-destination
  namespace: test
spec:
  host: podinfo
  trafficPolicy:
    loadBalancer:
      consistentHash:
        httpCookie:
          name: istiouser
          ttl: 30s
  subsets:
    - name: primary
      labels:
        app: podinfo
        role: primary
    - name: canary
      labels:
        app: podinfo
        role: canary
