【问题标题】:Istio: conditional-rate-limits based on UrlIstio:基于 Url 的条件速率限制
【发布时间】:2018-08-14 09:41:09
【问题描述】:

我想根据请求中 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

谢谢, 布伦特

【问题讨论】:

    标签: kubernetes google-kubernetes-engine rate-limiting istio


    【解决方案1】:

    来自 Istio Google Group 的 Martin!

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

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

    希望对你有帮助

    【讨论】:

      【解决方案2】:

      限速配置分为两部分。

      客户端 搅拌机侧

      运行以下命令以使用 memquota 启用速率限制:

      $ kubectl apply -f samples/bookinfo/policy/mixer-rule-productpage-ratelimit.yaml

      有关启用速率限制,请参阅随附的链接 [1]。

      [1]https://istio.io/docs/tasks/policy-enforcement/rate-limiting/

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-06-21
        • 1970-01-01
        • 2011-11-29
        相关资源
        最近更新 更多