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

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

YAML编辑基于条件的分流

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

apiVersion: v1
kind: VirtualService
metadata:
  name: ratings-route
spec:
  hosts:
  - ratings.prod.svc.cluster.local
  http:
  - 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_0018.html