1apiVersion: "config.istio.io/v1alpha2"
2kind: handler
3metadata:
4  name: memquota
5  namespace: istio-system
6spec:
7  compiledAdapter: memquota
8  params:
9    quotas:
10    - name: requestcount.quota.istio-system
11      maxAmount: 5000
12      validDuration: 1s
13      # The first matching override is applied.
14      # A requestcount instance is checked against override dimensions.
15      overrides:
16      # The following override applies to 'ratings' when
17      # the source is 'reviews'.
18      - dimensions:
19          destination: ratings
20          source: reviews
21        maxAmount: 1
22        validDuration: 1s
23      # The following override applies to 'ratings' regardless
24      # of the source.
25      - dimensions:
26          destination: ratings
27        maxAmount: 100
28        validDuration: 1s
29---
30apiVersion: "config.istio.io/v1alpha2"
31kind: quota
32metadata:
33  name: requestcount
34  namespace: istio-system
35spec:
36  dimensions:
37    source: source.labels["app"] | "unknown"
38    sourceVersion: source.labels["version"] | "unknown"
39    destination: destination.labels["app"] | destination.service.name | "unknown"
40    destinationVersion: destination.labels["version"] | "unknown"
41
42---
43apiVersion: "config.istio.io/v1alpha2"
44kind: rule
45metadata:
46  name: quota
47  namespace: istio-system
48spec:
49  actions:
50  - handler: memquota
51    instances:
52    - requestcount.quota
53