【发布时间】:2021-07-12 23:41:19
【问题描述】:
我在 mesh-virtual-service 中定义金丝雀路由,并想知道我是否可以使其也适用于入口流量(使用 ingress-virtual-service)。使用类似下面的东西,但它不起作用(来自入口的所有流量都将转到非金丝雀版本)
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: test-deployment-app
namespace: test-ns
spec:
gateways:
- mesh
hosts:
- test-deployment-app.test-ns.svc.cluster.local
http:
- name: canary
match:
- headers:
x-canary:
exact: "true"
- port: 8080
headers:
response:
set:
x-canary: "true"
route:
- destination:
host: test-deployment-app-canary.test-ns.svc.cluster.local
port:
number: 8080
weight: 100
- name: stable
route:
- destination:
host: test-deployment-app.test-ns.svc.cluster.local
port:
number: 8080
weight: 100
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: test-deployment-app-internal
namespace: test-ns
spec:
gateways:
- istio-system/default-gateway
hosts:
- myapp.dev.bla
http:
- name: default
route:
- destination:
host: test-deployment-app.test-ns.svc.cluster.local
port:
number: 8080
weight: 100
所以当我调用myapp.dev.bla 时,我期待x-canary:true 响应标头,但我没有看到。
【问题讨论】:
-
我认为原因已经在:istio.io/latest/docs/ops/common-problems/network-issues/… 是否有解决办法来实现这一目标?
标签: kubernetes istio istio-gateway