istio / old_issues_repo

Deprecated issue-tracking repo, please post new issues or feature requests to istio/istio instead.
37 stars 9 forks source link

BUG: Mirroring not working in Istio 0.8.0? #379

Closed lordofthejars closed 6 years ago

lordofthejars commented 6 years ago

Is this a BUG or FEATURE REQUEST?: BUG

Did you review https://istio.io/help/ and existing issues to identify if this is already solved or being worked on?: Y Bug: Y

What Version of Istio and Kubernetes are you using, where did you get Istio from, Installation details

istioctl 0.8.0
kubectl 1.9.1
openshift 3.9.0

Is Istio Auth enabled or not ? Not

What happened:

I am trying to configure two services (v1, and v2) where v2 receives traffic because of mirroring. But or because of I have migrated incorrectly to the new format or because there is a bug, v2 is not receiving traffic.

What you expected to happen:

V2 also receives traffic

How to reproduce it:

I am using this document:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: recommendation
  namespace: tutorial
spec:
  hosts:
  - recommendation
  http:
  - route:
    - destination:
        host: recommendation
        subset: version-v1
      weight: 100
    - destination:
        host: recommendation
        subset: version-v2
    mirror:
      host: recommendation
      subset: version-v2
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: recommendation
  namespace: tutorial
spec:
  host: recommendation
  subsets:
  - name: version-v1
    labels:
      version: v1
  - name: version-v2
    labels:
      version: v2

For example, if I am doing 25%-75% instead of mirroring then it works but of course, I might be doing something wrong.

ymesika commented 6 years ago

I suspect there is some precedences conflict in your VirtualService. On one hand you indirectly specify 0 weight to v2 and on the other define it as the mirror destination. I wonder if it will work correctly if you change it to:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: recommendation
  namespace: tutorial
spec:
  hosts:
  - recommendation
  http:
  - route:
    - destination:
        host: recommendation
        subset: version-v1
    mirror:
      host: recommendation
      subset: version-v2

(removed the weight and the v2 destination).

lordofthejars commented 6 years ago

Yes it worked. I think now it has more sense, but I was influenced by alpha1 format :)

Thanks.