Weight key word not recognized in VirtualService - istio 1.9.2

Using istio 1.9.2:

Ran istioctl validate -f: agains yaml file.

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: product
spec:
  hosts:
  - product.abc.svc.cluster.local
  http:
    route:
    - destination:
        host: product.abc.svc.cluster.local
        subset: v1
      weight: 50
  - route:
    - destination:
        host: product.abc.svc.cluster.local
        subset: v2
      weight: 50

Got the following error:

  • yaml: line 13: did not find expected key

Does not seem to like weight key word. Anyone else encountering a similar problem?

Fixed the problem. It was just an unnecessary route.