小编Z b*_*ast的帖子

为什么显式协议设置会导致流量路由错误?

我编写了一个虚拟服务来测试基于标头的路由

apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: http-app
  namespace: default
spec:
  hosts:
    - http-app.default.svc.cluster.local
  http:
    - match:
        - headers:
            canary-token:
              exact: haha
      route:
        - destination:
            host: http-app.default.svc.cluster.local
            subset: canary
    - route:
        - destination:
            host: http-app.default.svc.cluster.local
            subset: stable
Run Code Online (Sandbox Code Playgroud)

服务正常时流量路由正确

apiVersion: v1
kind: Service
metadata:
  name: http-app
  namespace: default
  labels:
    env: prod
spec:
  type: ClusterIP
  selector:
    app: http-app
  ports:
    - port: 3011
      targetPort: 3011
Run Code Online (Sandbox Code Playgroud)
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: http-app
  namespace: default
spec:
  hosts:
    - http-app.default.svc.cluster.local
  http:
    - match:
        - headers: …
Run Code Online (Sandbox Code Playgroud)

kubernetes istio envoyproxy

5
推荐指数
1
解决办法
155
查看次数

标签 统计

envoyproxy ×1

istio ×1

kubernetes ×1