How can I mirror traffic to two places with Istio?

1/16/2019

As part of my continuous deployment pipeline I deploy a canary and baseline, compare metrics from both and analyse the results to decide whether to promote the canary to production. In order to improve the metrics gathered I want to use Istio to mirror production traffic to both the canary and baseline deployments.

To this end I have the following virtual service and destination rule which mirrors traffic to my canary deployment:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: goldengoose
  namespace: goldengoose
spec:
  hosts:
  - "*"
  gateways:
  - goldengoose
  http:
  - route:
    - destination:
        port:
          number: 80
        host: goldengoose
        subset: prod
    mirror:
      host: goldengoose
      subset: canary
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: goldengoose
  namespace: goldengoose
spec:
  host: goldengoose
  subsets:
  - name: prod
    labels:
      track: prod
  - name: baseline
    labels:
      track: baseline
  - name: canary
    labels:
      track: canary

How can I also mirror traffic to the baseline so that both the baseline and canary recieve the same traffic as my production deployment?

-- dippynark
canary-deployment
istio
kubernetes

0 Answers