Last active
December 5, 2019 12:20
-
-
Save pichuang/a892b8cbada81a3b96810f145fa2ae26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: "config.istio.io/v1alpha2" | |
kind: rule | |
metadata: | |
name: quota | |
namespace: istio-system | |
spec: | |
actions: | |
- handler: handler.memquota | |
instances: | |
- requestcount.quota | |
match: match(request.headers["cookie"], "user=tester") == false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: "config.istio.io/v1alpha2" | |
kind: memquota | |
metadata: | |
name: handler | |
namespace: istio-system | |
spec: | |
quotas: | |
- name: requestcount.quota.istio-system | |
maxAmount: 200 | |
validDuration: 1s | |
overrides: | |
- dimensions: | |
destination: reviews | |
maxAmount: 4 | |
validDuration: 5s |
Istio 速率限制可以讓 普通用戶在使用reviews
服務時,只被提供免費的 quota,若超過免費 quota 的請求,則被限制。
rate_limit-advanced,yaml
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rate_limit.yaml:
Memquota
規定reviews
服務在 5 秒內最多能被訪問 4 次