【发布时间】:2020-05-28 01:18:10
【问题描述】:
假设我有一个 istio 的配置(我使用 GCP):
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: my-route
namespace: my-service
spec:
hosts:
- "service.cluster.local"
http:
- match:
- headers:
specific-id:
regex: ^(1|2|3|4|5)$
route:
- destination:
host: "service.cluster.local"
subset: s-01
- match:
- headers:
specific-id:
regex: ^(6|7|8|9|10)$
route:
- destination:
host: "service.cluster.local"
subset: s-02
我的目标规则基于特定的标头(int 值)。
现在我想改变这个配置(因为我需要重新分片),我会有这样的东西:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: my-route
namespace: my-service
spec:
hosts:
- "service.cluster.local"
http:
- match:
- headers:
specific-id:
regex: ^(1|2|3|9|10)$
route:
- destination:
host: "service.cluster.local"
subset: s-03
- match:
- headers:
specific-id:
regex: ^(4|5|6|7|8|)$
route:
- destination:
host: "service.cluster.local"
subset: s-04
- match:
- headers:
specific-id:
regex: ^(1|3|5|7|9|)$
route:
- destination:
host: "service.cluster.local"
subset: s-05
我的问题是:
istio 规则是否允许在子集中有交集(例如 有一个服务正则表达式:
^(1|2|3|4|5)$和另一个^(1|3|5|7|9|)$)?使用新规则部署新模式后,当 istio 将 应用它? istio 是否保证它不会被应用(不 删除旧规则)在我的所有新实例都准备好之前 交通?
【问题讨论】:
-
这些配置有效吗?您使用哪个版本的 istio?
-
@PiotrMalec istio 1.2.4。第一个是我的生产配置,它工作正常。第二个是我想拥有的(我的想法)。我没有用流量测试过。
标签: kubernetes google-cloud-platform istio