首页 > 解决方案 > 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

谢谢,布伦特

标签: kubernetesgoogle-kubernetes-enginerate-limitingistio

解决方案


来自 Istio Google Group 的 Martin!

我认为如果您从 request.uri 更改为 request.path,事情应该开始为您工作。

这是支持的属性集:https ://istio.io/docs/reference/config/policy-and-telemetry/attribute-vocabulary/

我希望这有帮助


推荐阅读