Skip to content

Instantly share code, notes, and snippets.

@yokawasa
Last active September 13, 2018 22:09
Show Gist options
  • Save yokawasa/f115fa3932b36a7a0c4465283b03ec18 to your computer and use it in GitHub Desktop.
Save yokawasa/f115fa3932b36a7a0c4465283b03ec18 to your computer and use it in GitHub Desktop.
istio-workshop.md
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: reviews
  ...
spec:
  hosts:
  - reviews
  http:
  - route:
    - destination:
        host: reviews
        subset: v1
      weight: 75
  - route:
    - destination:
        host: reviews
        subset: v3
      weight: 25
apiVersion: networking.istio.io/v1alpha3 
kind: VirtualService
metadata:
  name: route-rule-mirror
spec:
  hosts:
  - reviews
  http:
  - route:
    - destination:
      host: reviews
      subset: v1 
    mirror:
      host: reviews 
      subset: v2
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: httpbin
spec:
  host: httpbin
  trafficPolicy:
    connectionPool:
      tcp:
        maxConnections: 1
      http:
        http1MaxPendingRequests: 1
        maxRequestsPerConnection: 1
    outlierDetection:
      consecutiveErrors: 1
      interval: 1s
      baseEjectionTime: 3m
      maxEjectionPercent: 100
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: ratings
spec:
  hosts:
  - ratings
  http:
  - match:
    - headers:
        end-user:
          exact: jason
    fault:
      delay:
        percent: 100
        fixedDelay: 7s
    route:
    - destination:
        host: ratings
        subset: v1
  - route:
    - destination:
        host: ratings
        subset: v1
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: ratings
spec:
  hosts:
  - ratings
  http:
  - match:
    - headers:
        end-user:
          exact: jason
    fault:
      abort:
        percent: 100
        httpStatus: 500
    route:
    - destination:
        host: ratings
        subset: v1
  - route:
    - destination:
        host: ratings
        subset: v1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment