Using the Bookinfo example app from the site, I have tried to setup weighted routing with stickiness.
This is the destination rule I’ve used:
apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: reviews spec: host: reviews trafficPolicy: loadBalancer: consistentHash: useSourceIp: true subsets: - name: v1 labels: version: v1 - name: v2 labels: version: v2 - name: v3 labels: version: v3
This is the virtualservice I have used:
apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: reviews spec: hosts: - reviews http: - route: - destination: host: reviews subset: v1 weight: 80 - destination: host: reviews subset: v2 weight: 15 - destination: host: reviews subset: v3 weight: 5
When neither have been applied the bookinfo app routes traffic amongst the three reviews versions using the default method and they all get about the same traffic.
When I just have the virtualservice applied, the traffic is routed using the weights provided.
When I just have the destination rule applied, the traffic is routed with stickiness in effect.
However, when I have both applied at the same time it appears the stickiness is no longer taken in to account. Is there any way to be able to use the destination rules’ consistent hash LB feature along with custom weighting for subsets of a service?