Istio虚拟服务匹配uri和cookie不起作用

问题描述 投票:0回答:1

我一直在尝试为我的微服务应用此虚拟服务Yaml:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: nameko-notifyms
spec:
  hosts:
  - "*"
  gateways:
  - nameko-notifyms-gateway
  http:
  - match:
    - headers:
        cookie:
          regex: "^(.*?;)?(user=joe)(;.*)?"
      uri:
        exact: /hello
    route:
    - destination:
        host: nameko-notifyms
        port:
          number: 8000

使用上面的代码块,将uri卷曲后,没有流量进入Pod。

如果我注释掉信息,如下面的代码块所示:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: nameko-notifyms
spec:
  hosts:
  - "*"
  gateways:
  - nameko-notifyms-gateway
  http:
  - match:
#    - headers:
#        cookie:
#          regex: "^(.*?;)?(user=joe)(;.*)?"
    - uri:
        exact: /hello
    route:
    - destination:
        host: nameko-notifyms
        port:
          number: 8000

流量被引导至广告连播,可以在下图中显示:enter image description here

邮递员设置如下:enter image description here

networking kubernetes microservices istio
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.