gloo-mesh icon indicating copy to clipboard operation
gloo-mesh copied to clipboard

Using RateLimitClientConfig does not create an EnvoyFilter with uniqueValue descriptor

Open antonioberben opened this issue 2 years ago • 0 comments

Gloo Mesh Version

1.2.x (latest stable)

Istio Version

1.11.x

Describe the bug

With GMG, you apply a client ratelimit using raw and it works. However, when using the same configuration with RateLimitClientConfig the rate limit is not applied.

Steps to reproduce the bug

With a GlooMesh installation and a minimum of 1 remote cluster:

  1. Install bookinfo application to test
  2. From the attached compress file, apply the VirtualHost and the RateLimitServerConfig resources. Notice that that the VHost has the rate limit client configuration as raw
  3. Check in the remote cluster the generated EnvoyFilter that there are 3 actions. It should look like this:
    patch:
      operation: MERGE
      value:
        route:
          rateLimits:
          - actions:
            - genericKey:
                descriptorValue: gloo-mesh.rl-config
            - genericKey:
                descriptorValue: solo.setDescriptor.uniqueValue
            - genericKey:
                descriptorValue: count
  1. Verify the ratelimit is working trying to reach the application more than 5 times. A 429 error should be returned
  2. Now, apply the RateLimitClientConfig resource from the attached zip file. It contains the same rate limit rule than in the raw
  3. Comment out the raw block in the VHost resource and point to the just applied RateLimitClientConfig:
    options:
      rateLimit:
        # raw:
        #   rateLimits:
        #   - setActions:
        #     - genericKey:
        #         descriptorValue: count
        ratelimitClientConfigRef:
          name: default-ratelimit-client-config
          namespace: gloo-mesh
        ratelimitServerConfigSelector:
          namespaces:
          - gloo-mesh
  1. Check the generated EnvoyFilter in the remote cluster. Now there are only two actions:
    patch:
      operation: MERGE
      value:
        route:
          rateLimits:
          - actions:
            - genericKey:
                descriptorValue: gloo-mesh.rl-config
            - genericKey:
                descriptorValue: count
            stage: 1

The descriptorValue: solo.setDescriptor.uniqueValue is missing. 7. Try to reach the application more than 5 times. And the rate limit is never triggered.

Thank you

Expected Behavior

When I apply a RateLimitClientConfig, it will work as same as with raw in the VHost. The RateLimit is, therefore, triggered.

Additional Context

sources.zip

antonioberben avatar Jan 18 '22 10:01 antonioberben