Skip to content

Latest commit

 

History

History
85 lines (71 loc) · 1.78 KB

README.md

File metadata and controls

85 lines (71 loc) · 1.78 KB

Bookinfo

Rewrite Bookinfo project using hertz, kitex

Architecture

img.png

Lane

lane.png

Traffic routing example

Define routing rules

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: reviews
spec:
  hosts:
    - reviews
  http:
    - match:
        - headers:
            baggage:
              exact: "env=dev"
      route:
        - destination:
            host: reviews
            subset: v2
          weight: 100
    - route:
        - destination:
            host: reviews
            subset: v1
          weight: 80
        - destination:
            host: reviews
            subset: v3
          weight: 20

---

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: ratings
spec:
  hosts:
    - ratings
  http:
    - match:
        - headers:
            baggage:
              exact: "env=dev"
      route:
        - destination:
            host: ratings
            subset: v2
          weight: 100
    - route:
        - destination:
            host: ratings
            subset: v1
          weight: 100

Request base lane service, rating 0 or 1 randomly

bookinfo_1.png bookinfo_2.png

Set the request coloring flag through the browser mod-header plugin

bookinfo_3.png

Click the refresh button again, you can find that the request hits the branch lane, and the rating becomes 5

bookinfo_4.png

View Tracing

tracing-topo tracing

View Topology

operation-topo