kubernetes - Istio:基于 Url 的条件速率限制
问题描述
我想根据请求中 URL 的匹配来更新条件速率限制。
我找到了这些文档,https://istio.io/docs/reference/config/policy-and-telemetry/istio.policy.v1beta1/#Rule
但无法追踪要使用的正确属性
作为猜测,我试过了
apiVersion: config.istio.io/v1alpha2
kind: rule
metadata:
name: quota
namespace: istio-system
spec:
match: match(request.uri, "/A/B/93*") == true
actions:
- handler: handler.memquota
instances:
- requestcount.quota
但是那个错误
Unable to compile match condition expression: 'unknown attribute request.uri', rule='quota.rule.istio-system',
enter code here
谢谢,布伦特
解决方案
来自 Istio Google Group 的 Martin!
我认为如果您从 request.uri 更改为 request.path,事情应该开始为您工作。
这是支持的属性集:https ://istio.io/docs/reference/config/policy-and-telemetry/attribute-vocabulary/
我希望这有帮助
推荐阅读
- html - 如何在 snipcart 的付款部分添加文本?
- javascript - Lodash 的 .map 不保证迭代顺序?
- html - 面临html中文本对齐的困难
- python - 如何为熊猫数据框绘制箱线图,日期为日/周/月?
- python - 为什么发生过拟合时随机森林最大深度参数的验证分数不会缩小
- wpf - 如何在后面的组合框代码中更改背景
- kotlin-multiplatform - 如何将 Objective-C 对象传递给 Kotlin Native 框架?
- sql - SQL Server分层查找经理的所有经理并插入
- c - 如何在C中的另一个函数中使用函数返回?
- c - LinkList 未添加新节点