docs: add ADC and Ingress Controller tabs to limit-req plugin docs#13216
docs: add ADC and Ingress Controller tabs to limit-req plugin docs#13216Yilialinn wants to merge 1 commit intoapache:masterfrom
Conversation
Port limit-req plugin documentation from API7 docs with all three tabs (Admin API, ADC, Ingress Controller) for all example sections. Apply audit fixes: rate/burst type to number, key as required with no default, redis_cluster_nodes minimum to one address. Add Local vs Redis Rate Limiting section. Fix ZH doc typos and remove non-existent attributes.
There was a problem hiding this comment.
Pull request overview
This PR updates the limit-req plugin documentation to provide consistent, multi-environment configuration examples (Admin API / ADC / Ingress Controller) and to align documented attributes with the actual plugin schema.
Changes:
- Add ADC and Ingress Controller (Gateway API + APISIX CRD) tabs to all example sections.
- Add a “Local vs Redis Rate Limiting” section describing the two enforcement modes.
- Correct attribute documentation to match source code (e.g.,
rate/bursttypes, requiredkey, Redis cluster node requirements).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/zh/latest/plugins/limit-req.md | Adds multi-tab examples, adds local-vs-Redis explanation, and corrects the ZH attribute table and typos. |
| docs/en/latest/plugins/limit-req.md | Adds multi-tab examples, adds local-vs-Redis explanation, and updates the EN attribute table to match schema. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ❶ `rate`: limit the QPS to 1. | ||
|
|
||
| ❷ `key`: set to `remote_addr` to apply rate limiting quota by remote address and consumer. |
There was a problem hiding this comment.
In the “Apply Rate Limiting by Remote Address” example, this note says the key applies quota by remote address and consumer, but the configuration only uses remote_addr and does not involve consumer identity. Please adjust the wording to avoid implying consumer-based limiting here.
| ❷ `key`: set to `remote_addr` to apply rate limiting quota by remote address and consumer. | |
| ❷ `key`: set to `remote_addr` to apply rate limiting quota by remote address. |
| | key_type | string | False | var | ["var", "var_combination"] | The type of key. If the `key_type` is `var`, the `key` is interpreted a variable. If the `key_type` is `var_combination`, the `key` is interpreted as a combination of variables. | | ||
| | key | string | True | | | The key to count requests by. If the `key_type` is `var`, the `key` is interpreted a variable. The variable does not need to be prefixed by a dollar sign (`$`). If the `key_type` is `var_combination`, the `key` is interpreted as a combination of variables. All variables should be prefixed by dollar signs (`$`). For example, to configure the `key` to use a combination of two request headers `custom-a` and `custom-b`, the `key` should be configured as `$http_custom_a $http_custom_b`. | |
There was a problem hiding this comment.
The key_type description has a grammatical error (“interpreted a variable” / “interpreted as a combination…” is missing “as”). Please update these phrases (e.g., “interpreted as a variable”) to improve clarity.
| | key_type | string | False | var | ["var", "var_combination"] | The type of key. If the `key_type` is `var`, the `key` is interpreted a variable. If the `key_type` is `var_combination`, the `key` is interpreted as a combination of variables. | | |
| | key | string | True | | | The key to count requests by. If the `key_type` is `var`, the `key` is interpreted a variable. The variable does not need to be prefixed by a dollar sign (`$`). If the `key_type` is `var_combination`, the `key` is interpreted as a combination of variables. All variables should be prefixed by dollar signs (`$`). For example, to configure the `key` to use a combination of two request headers `custom-a` and `custom-b`, the `key` should be configured as `$http_custom_a $http_custom_b`. | | |
| | key_type | string | False | var | ["var", "var_combination"] | The type of key. If the `key_type` is `var`, the `key` is interpreted as a variable. If the `key_type` is `var_combination`, the `key` is interpreted as a combination of variables. | | |
| | key | string | True | | | The key to count requests by. If the `key_type` is `var`, the `key` is interpreted as a variable. The variable does not need to be prefixed by a dollar sign (`$`). If the `key_type` is `var_combination`, the `key` is interpreted as a combination of variables. All variables should be prefixed by dollar signs (`$`). For example, to configure the `key` to use a combination of two request headers `custom-a` and `custom-b`, the `key` should be configured as `$http_custom_a $http_custom_b`. | |
|
|
||
| ❶ `rate`:将 QPS 限制为 1。 | ||
|
|
||
| ❷ `key`:设置为 `remote_addr`,以按远程地址和消费者应用速率限制配额。 |
There was a problem hiding this comment.
此处说明 key 会“按远程地址和消费者”应用配额,但本示例仅使用 remote_addr,未涉及消费者信息(也未启用认证插件)。建议把表述改为仅按远程地址进行速率限制,避免误导。
| ❷ `key`:设置为 `remote_addr`,以按远程地址和消费者应用速率限制配额。 | |
| ❷ `key`:设置为 `remote_addr`,以按远程地址应用速率限制配额。 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Port
limit-reqplugin documentation with all three configuration tabs (Admin API, ADC, Ingress Controller) for all example sections.Changes
rateandburstattribute types fromintegertonumberto match source codekeyattribute to be required with no default (was incorrectly showingremote_addras default)redis_cluster_nodesdescription from "at least two addresses" to "at least one address"busttypo toburst, remove duplicateallow_degradationrow, remove non-existentshow_limit_quota_headerattribute, fixredis_cluster_nametable formatting