Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- apiVersion: config.istio.io/v1alpha2
- kind: memquota
- metadata:
- name: handler
- spec:
- quotas:
- - name: requestcount.quota.istio-system
- maxAmount: 500
- validDuration: 1s
- # The first matching override is applied.
- # A requestcount instance is checked against override dimensions.
- overrides:
- # The following override applies to 'reviews' regardless
- # of the source.
- - dimensions:
- destination: recommendation
- maxAmount: 4
- validDuration: 5s
- ---
- apiVersion: config.istio.io/v1alpha2
- kind: quota
- metadata:
- name: requestcount
- spec:
- dimensions:
- source: request.headers["x-forwarded-for"] | "unknown"
- destination: destination.labels["app"] | destination.service.name | "unknown"
- destinationVersion: destination.labels["version"] | "unknown"
- ---
- apiVersion: config.istio.io/v1alpha2
- kind: QuotaSpec
- metadata:
- name: request-count
- spec:
- rules:
- - quotas:
- - charge: 1
- quota: requestcount
- ---
- apiVersion: config.istio.io/v1alpha2
- kind: QuotaSpecBinding
- metadata:
- name: request-count
- spec:
- quotaSpecs:
- - name: request-count
- namespace: USERNAME-smcp
- services:
- - name: recommendation
- namespace: USERNAME-tutorial
- # - service: '*' # Uncomment this to bind *all* services to request-count
- ---
- apiVersion: config.istio.io/v1alpha2
- kind: rule
- metadata:
- name: quota
- spec:
- # quota only applies if you are not logged in.
- # match: match(request.headers["cookie"], "user=*") == false
- actions:
- - handler: handler.memquota
- instances:
- - requestcount.quota
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement