apiVersion: networking.istio.io/v1
kind: ServiceEntry
metadata:
  name: fault
  namespace: testns
spec:
   hosts:
   - fault.test.istio.io
   ports:
   - number: 8080
     name: http
     protocol: HTTP
   resolution: STATIC
   endpoints:
    - address: 127.0.0.2
      ports:
        http: 8080
      labels:
        version: v1
    - address: 127.0.0.3
      ports:
        http: 8081
      labels:
        version: v2
---
apiVersion: networking.istio.io/v1
kind: DestinationRule
metadata:
  name: fault
  namespace: testns
spec:
  host: c-weighted.extsvc.com
  subsets:
    - name: v1
      labels:
        version: v1
    - name: v2
      labels:
        version: v2

---
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
  name: fault
  namespace: testns
spec:
  hosts:
    - fault.test.istio.io
  http:
    - match:
      - headers:
          version:
            exact: v2
        sourceLabels:
          version: v1
      route:
      - destination:
          host: c
          subset: v2
        weight: 100
      fault:
        delay:
          percentage:
            value: 100.0
          fixedDelay: 5s
        abort:
          percentage:
            value: 100.0
          httpStatus: 503
