Prerequisites
Configuration Steps
Envoy’s Rate Limit project is deployed as a Workload at Control Plane and requires a local Redis Workload. Follow the steps below to download and apply a YAML manifest file which will deploy, create, and configure:- The Rate Limit Workload.
- The Redis Workload.
- An opaque secret containing the rate limiting definition.
- A Workload Identity for the Rate Limit Workload.
- A Policy allowing the Rate Limit Workload to reveal the secret.
Step One - Configure the Rate Limiting Workload
- Download and review the YAML manifest file that will be applied.
- Using the UI or CLI:
- Create a GVC named
ratelimit
. If you choose a different GVC name, update the YAML manifest file accordingly. - Within that GVC, use the cpln apply command to deploy the manifest file.
- Create a GVC named
The latest
envoyproxy/ratelimit
deployment can be obtained here.The downloaded YAML manifest file uses the image envoyproxy/ratelimit:5b6e65da
. If there is a newer tag, it can be substituted in the YAML file before executing the cpln apply
command.Step Two - Customize the Config File
The rate limit config file is stored as an opaque secret namedratelimit-config
that was created when applying the YAML manifest file.
The configuration that was deployed with the manifest file sets a limit of 10 requests per minute for any request that contains an authorization
header (see sample config below).
To adjust the rate limit per your requirments, use the UI or CLI to edit the ratelimit-config
secret using the pattern referenced here.
Sample Config
YAML
After saving the updated secret, it’s recommended to perform a
Force Redeploy
of the ratelimit
Workload to reload the config file.Step Three - Configure Rate Limiting on a Workload
Add the following tags to enable rate limiting on the desired Workload.cpln/rateLimitAddress
cpln/rateLimitScheme
- Optional.
- Default is:
https:
.
cpln/rateLimitPort
- Optional.
- Default is:
443
.
cpln/rateLimitDomain
- Optional.
- Default is:
cpln
. - This value corresponds to the domain entry within the config file that was configured in step 2.
cpln/rateLimitDescriptors
- Optional. Default is:
authorization
. - Allowed values:
authorization
,host
,path
. - This value corresponds to the descriptor entry within the config file that was configured in step 2.
- Optional. Default is: