华为云UCS-基于组合条件的分流:YAML编辑基于组合条件的分流

时间:2024-09-12 15:06:05

YAML编辑基于组合条件的分流

当前数据选择YAML,在编辑栏进行编辑。YAML设置示例如下(根据实际需求调整配置参数):

apiVersion: v1
kind: VirtualService
metadata:
  name: reviews-route
spec:
  hosts:
  - reviews.prod.svc.cluster.local
  http:
  - route:
    - destination:
        host: reviews.prod.svc.cluster.local
        subset: v2
      weight: 25
    - destination:
        host: reviews.prod.svc.cluster.local
        subset: v1
      weight: 75
  - match:
    - headers:
        end-user:
          exact: jason
      uri:
        prefix: "/ratings/v2/"
    route:
    - destination:
        host: ratings.prod.svc.cluster.local
support.huaweicloud.com/usermanual-ucs/ucs_02_0020.html