<p>I am trying to enable the rate-limit for my istio enabled service. But it doesn't work. How do I debug if my configuration is correct?</p>

<pre><code>apiVersion: config.istio.io/v1alpha2
kind: memquota
metadata:
  name: handler
  namespace: istio-system
spec:
  quotas:
  - name: requestcount.quota.istio-system
    maxAmount: 5
    validDuration: 1s
    overrides:
    - dimensions:
        engine: myEngineValue
      maxAmount: 5
      validDuration: 1s
---
apiVersion: config.istio.io/v1alpha2
kind: quota
metadata:
  name: requestcount
  namespace: istio-system
spec:
  dimensions:
    source: request.headers["x-forwarded-for"] | "unknown"
    destination: destination.labels["app"] | destination.service | "unknown"
    destinationVersion: destination.labels["version"] | "unknown"
    engine: destination.labels["engine"] | "unknown"
---
apiVersion: config.istio.io/v1alpha2
kind: QuotaSpec
metadata:
  name: request-count
  namespace: istio-system
spec:
  rules:
  - quotas:
    - charge: 1
      quota: requestcount
---
apiVersion: config.istio.io/v1alpha2
kind: QuotaSpecBinding
metadata:
  name: request-count
  namespace: istio-system
spec:
  quotaSpecs:
  - name: request-count
    namespace: istio-system
  services:
  # - service: '*' ; I tried with this as well
  - name: my-service
    namespace: default
---
apiVersion: config.istio.io/v1alpha2
kind: rule
metadata:
  name: quota
  namespace: istio-system
spec:
  actions:
  - handler: handler.memquota
    instances:
    - requestcount.quota
</code></pre>

<p>I tried with <code>- service: '*'</code> as well in the <code>QuotaSpecBinding</code>; but no luck.</p>

<p>How, do I confirm if my configuration was correct? the <code>my-service</code> is the kubernetes service for my deployment. (Does this have to be a VirtualService of istio for rate limits to work? <strong>Edit: Yes, it has to!</strong>)</p>

<p>I followed <a href="https://istio.io/docs/tasks/policy-enforcement/rate-limiting/" rel="nofollow noreferrer">this doc</a> except the VirtualService part.</p>

<p>I have a feeling somewhere in the namespaces I am doing a mistake.</p>

enator
<p>You have to define the virtual service for the service <code>my-service</code>:</p>

<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: myservice
spec:
  hosts:
  - myservice
  http:
  - route:
    - destination:
        host: myservice
</code></pre>

<p>This way, you allow Istio to know which service are you host you are referring to.</p>

<p>In terms of debugging, I know that there is a project named <a href="http://kiali.io" rel="nofollow noreferrer">Kiali</a> that aims to leverage observability in Istio environments. I know that they have validations for some Istio and Kubernetes objects: <a href="https://www.kiali.io/features/istio-configuration/" rel="nofollow noreferrer">Istio configuration browse</a>. </p>
