如何组织 Istio 限速策略配置

How to organize Istio rate limiting policy configuration

让我为部署到单个集群的各个独立团队展示一个用例 A组负责服务A1、A2、A3 B队负责服务B1、B2、B3

他们都打算对他们的服务应用自定义速率限制。我的问题是:

Should/Could 它们都定义了完全不同的配置(由以下 5 个 yalm 规范组成)还是其中的一部分是通用的?至少,我猜 "quota instance" 可以共享,而其余部分可能不同。

从 istio 站点 ( https://istio.io/docs/tasks/policy-enforcement/rate-limiting/#rate-limits ),配置分为

就我而言,你应该能够做到。

您应该从创建单个 redis 处理程序和基于单个维度进行限制的简单规则开始,然后尝试将其应用于团队 A 的服务,并创建适用于服务 B 的类似规则。

Should/Could they both define completely different config(consisting of the following 5 yalm spec) or is part of it common?

Handler - a single one, to connect to Redis or to keep all the rate limiting info in one place

Instance - This can be single, or there can be 2 - depending on usecase

QuotaSpec - as many as instances defined

QuotaSpecBinding - two or even more

Rule - Depends on usecase, You probably start with one, but eventually may use two or more

如果你想基于相同的维度进行速率限制,一个共享实例就足够了。

单实例是可以的,除非团队想使用不同的维度,那么显然你需要两个单独的配额实例。

我发现了类似 namespace tenancy on istio documentation 的东西,我想如果你愿意,你可以为团队 A 和团队 B 创建两个独立的命名空间。