Istio: conditional-rate-limits based on Url

8/14/2018

I would like to update the conditional-rate-limit to be based on a match of the URL in the request.

I found these docs, https://istio.io/docs/reference/config/policy-and-telemetry/istio.policy.v1beta1/#Rule

But can't track down what the correct attribute would be to use


As a guess, I tried

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

But that errors with

Unable to compile match condition expression: 'unknown attribute request.uri', rule='quota.rule.istio-system',
enter code here

Thanks, Brent

-- brent
google-kubernetes-engine
istio
kubernetes
rate-limiting

2 Answers

8/16/2018

From Martin on the Istio Google Group!

I think if you change from request.uri to request.path, things should start working for you.

Here's the set of supported attributes: https://istio.io/docs/reference/config/policy-and-telemetry/attribute-vocabulary/

I hope this helps

-- brent
Source: StackOverflow

8/17/2018

Rate limit configuration is split into two parts.

Client Side Mixer Side

Run the following command to enable rate limits using memquota:

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

See the attached link[1] for enabling Rate Limits.

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

-- Muhammad Ebaduddin
Source: StackOverflow