This is an automated email from the ASF dual-hosted git repository.

Yilialinn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new b15341d40 docs: fix broken paragraph and add custom headers example 
for limit-count (#13171)
b15341d40 is described below

commit b15341d4083146cd1a5954ba559d2a8f8b370d03
Author: Yilia Lin <[email protected]>
AuthorDate: Mon Apr 20 14:13:31 2026 +0800

    docs: fix broken paragraph and add custom headers example for limit-count 
(#13171)
---
 docs/en/latest/plugins/limit-count.md | 1425 +++++++++++++++++++++++++++++++-
 docs/zh/latest/plugins/limit-count.md | 1461 ++++++++++++++++++++++++++++++++-
 2 files changed, 2850 insertions(+), 36 deletions(-)

diff --git a/docs/en/latest/plugins/limit-count.md 
b/docs/en/latest/plugins/limit-count.md
index 512c66fe5..7c7e7dd76 100644
--- a/docs/en/latest/plugins/limit-count.md
+++ b/docs/en/latest/plugins/limit-count.md
@@ -30,6 +30,9 @@ description: The limit-count plugin uses a fixed window 
algorithm to limit the r
   <link rel="canonical" href="https://docs.api7.ai/hub/limit-count"; />
 </head>
 
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
 ## Description
 
 The `limit-count` plugin uses a fixed window algorithm to limit the rate of 
requests by the number of requests within a given time interval. Requests 
exceeding the configured quota will be rejected.
@@ -44,11 +47,11 @@ You may see the following rate limiting headers in the 
response:
 
 | Name                    | Type    | Required                                 
 | Default       | Valid values                           | Description         
                                                                                
                                                                                
                                                                                
                                                                                
              [...]
 | ----------------------- | ------- | 
----------------------------------------- | ------------- | 
-------------------------------------- | 
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 [...]
-| count                   | integer | False                                    
 |               | > 0                              | The maximum number of 
requests allowed within a given time interval. Required if `rules` is not 
configured.                                                                     
                                                                                
                                                                                
                        [...]
-| time_window             | integer | False                                    
 |               | > 0                        | The time interval corresponding 
to the rate limiting `count` in seconds. Required if `rules` is not configured. 
                                                                                
                                                                                
                                                                                
              [...]
-| rules                   | array[object] | False                              
 |               |                            | A list of rate limiting rules. 
Each rule is an object containing `count`, `time_window`, and `key`.            
                                                                                
                                                                                
                                    |
-| rules.count             | integer | True                                     
 |               | > 0                        | The maximum number of requests 
allowed within a given time interval.                                           
                                                                                
                                                                                
                                  |
-| rules.time_window       | integer | True                                     
 |               | > 0                        | The time interval corresponding 
to the rate limiting `count` in seconds.                                        
                                                                                
                                                                                
                                 |
+| count                   | integer or string | False                          
           |               | > 0                              | The maximum 
number of requests allowed within a given time interval. Required if `rules` is 
not configured. Supports 
[lua-resty-expr](https://github.com/api7/lua-resty-expr) from APISIX 3.16.0.    
                                                                                
                                                                         [...]
+| time_window             | integer or string | False                          
           |               | > 0                        | The time interval 
corresponding to the rate limiting `count` in seconds. Required if `rules` is 
not configured. Supports 
[lua-resty-expr](https://github.com/api7/lua-resty-expr) from APISIX 3.16.0.    
                                                                                
                                                                           [...]
+| rules                   | array[object] | False                              
 |               |                            | A list of rate limiting rules. 
Each rule is an object containing `count`, `time_window`, and `key`.            
                                                                                
                                                                                
                                                                                
               [...]
+| rules.count             | integer or string | True                           
           |               | > 0                        | The maximum number of 
requests allowed within a given time interval. Supports 
[lua-resty-expr](https://github.com/api7/lua-resty-expr).                       
                                                                                
                                                                                
                                      [...]
+| rules.time_window       | integer or string | True                           
           |               | > 0                        | The time interval 
corresponding to the rate limiting `count` in seconds. Supports 
[lua-resty-expr](https://github.com/api7/lua-resty-expr).                       
                                                                                
                                                                                
                                  [...]
 | rules.key               | string  | True                                     
 |               |                            | The key to count requests by. 
If the configured key does not exist, the rule will not be executed. The `key` 
is interpreted as a combination of variables, for example: `$http_custom_a 
$http_custom_b`.                                                                
                                                                                
                      [...]
 | rules.header_prefix     | string  | False                                    
 |               |                            | Prefix for rate limit headers. 
If configured, the response will include `X-{header_prefix}-RateLimit-Limit`, 
`X-{header_prefix}-RateLimit-Remaining`, and 
`X-{header_prefix}-RateLimit-Reset` headers. If not configured, the index of 
the rule in the rules array is used as the prefix. For example, headers for the 
first rule will be `X-1-RateLimit-Limit`, `X-1-RateLim [...]
 | key_type                | string  | False                                    
 | var         | ["var","var_combination","constant"] | 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. If 
the `key_type` is `constant`, the `key` is interpreted as a constant.           
       |
@@ -69,7 +72,7 @@ You may see the following rate limiting headers in the 
response:
 | redis_timeout           | integer | False                                    
 | 1000          | [1,...]                                | The Redis timeout 
value in milliseconds when `policy` is `redis` or `redis-cluster`.              
                                                                                
                                                                                
                                                                                
                [...]
 | redis_keepalive_timeout       | integer | False                              
       | 10000         | ≥ 1000                                 | Keepalive 
timeout in milliseconds for redis when `policy` is `redis` or `redis-cluster`.  
                                    |
 | redis_keepalive_pool          | integer | False                              
       | 100           | ≥ 1                                    | Keepalive 
pool size for redis when `policy` is `redis` or `redis-cluster`.                
                                    |
-| redis_cluster_nodes     | array[string]   | False |               |          
                              | The list of the Redis cluster nodes with at 
least two addresses. Required when policy is redis-cluster.                     
                                                                                
                                                                                
                                                                                
                  [...]
+| redis_cluster_nodes     | array[string]   | False |               |          
                              | The list of Redis cluster nodes with at least 
one address. Required when `policy` is `redis-cluster`.                         
                                                                                
                                                                                
                                                                                
                [...]
 | redis_cluster_name      | string  | False |               |                  
                      | The name of the Redis cluster. Required when `policy` 
is `redis-cluster`.                                                             
                                                                                
                                                                                
                                                                                
                [...]
 | redis_cluster_ssl      | boolean  |  False |     false         |             
                           | If true, use SSL to connect to Redis cluster when 
`policy` is `redis-cluster`.                                                    
                                                                                
                                                                                
                                                                                
               [...]
 | redis_cluster_ssl_verify      | boolean  | False |    false      |           
                             | If true, verify the server SSL certificate when 
`policy` is `redis-cluster`.                                                    
                                                                                
                                                                                
                                                                                
               [...]
@@ -94,6 +97,17 @@ The following example demonstrates the rate limiting of 
requests by a single var
 
 Create a Route with `limit-count` plugin that allows for a quota of 1 within a 
30-second window per remote address:
 
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
 ```shell
 curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   -H "X-API-KEY: ${admin_key}" \
@@ -106,7 +120,8 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
         "time_window": 30,
         "rejected_code": 429,
         "key_type": "var",
-        "key": "remote_addr"
+        "key": "remote_addr",
+        "policy": "local"
       }
     },
     "upstream": {
@@ -118,6 +133,159 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+```yaml title="adc.yaml"
+services:
+  - name: httpbin
+    routes:
+      - uris:
+          - /get
+        name: limit-count-route
+        plugins:
+          limit-count:
+            count: 1
+            time_window: 30
+            rejected_code: 429
+            key_type: var
+            key: remote_addr
+            policy: local
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+Synchronize the configuration to the gateway:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: limit-count-plugin-config
+spec:
+  plugins:
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        key_type: var
+        key: remote_addr
+        policy: local
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: limit-count-route
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v2
+kind: ApisixUpstream
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  ingressClassName: apisix
+  externalNodes:
+  - type: Domain
+    name: httpbin.org
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixRoute
+metadata:
+  namespace: aic
+  name: limit-count-route
+spec:
+  ingressClassName: apisix
+  http:
+    - name: limit-count-route
+      match:
+        paths:
+          - /get
+      upstreams:
+      - name: httpbin-external-domain
+      plugins:
+      - name: limit-count
+        enable: true
+        config:
+          count: 1
+          time_window: 30
+          rejected_code: 429
+          key_type: var
+          key: remote_addr
+          policy: local
+```
+
+</TabItem>
+
+</Tabs>
+
+Apply the configuration to your cluster:
+
+```shell
+kubectl apply -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+</Tabs>
+
 Send a request to verify:
 
 ```shell
@@ -132,6 +300,17 @@ The request has consumed all the quota allowed for the 
time window. If you send
 
 The following example demonstrates the rate limiting of requests by a 
combination of variables, `remote_addr` and `consumer_name`. It allows for a 
quota of 1 within a 30-second window per remote address and for each consumer.
 
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
 Create a Consumer `john`:
 
 ```shell
@@ -182,7 +361,7 @@ curl 
"http://127.0.0.1:9180/apisix/admin/consumers/jane/credentials"; -X PUT \
   }'
 ```
 
-Create a Route with `key-auth` and `limit-count` plugins, and specify in the 
`limit-count` plugin to use a combination of variables as the rate limiting key:
+Create a Route with `key-auth` and `limit-count` plugins, and specify in the 
`limit-count` plugin to use a combination of variables as the rate limiting 
key. The `key-auth` plugin enables key authentication on the route. The 
`key_type` is set to `var_combination` to interpret the `key` as a combination 
of variables, and `key` is set to `$remote_addr $consumer_name` to apply rate 
limiting quota by remote address and for each consumer:
 
 ```shell
 curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
@@ -209,6 +388,235 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+Create two consumers and a route that enables rate limiting by consumers. The 
`key-auth` plugin enables key authentication on the route. The `key_type` is 
set to `var_combination` to interpret the `key` as a combination of variables, 
and `key` is set to `$remote_addr $consumer_name` to apply rate limiting quota 
by remote address and for each consumer:
+
+```yaml title="adc.yaml"
+consumers:
+  - username: john
+    credentials:
+      - name: key-auth
+        type: key-auth
+        config:
+          key: john-key
+  - username: jane
+    credentials:
+      - name: key-auth
+        type: key-auth
+        config:
+          key: jane-key
+services:
+  - name: limit-count-service
+    routes:
+      - name: limit-count-route
+        uris:
+          - /get
+        plugins:
+          key-auth: {}
+          limit-count:
+            count: 1
+            time_window: 30
+            rejected_code: 429
+            key_type: var_combination
+            key: "$remote_addr $consumer_name"
+            policy: local
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+Synchronize the configuration to the gateway:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+Create two consumers and a route that enables rate limiting by consumers. The 
`key-auth` plugin enables key authentication on the route. The `key_type` is 
set to `var_combination` to interpret the `key` as a combination of variables, 
and `key` is set to `$remote_addr $consumer_name` to apply rate limiting quota 
by remote address and for each consumer:
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v1alpha1
+kind: Consumer
+metadata:
+  namespace: aic
+  name: john
+spec:
+  gatewayRef:
+    name: apisix
+  credentials:
+    - type: key-auth
+      name: primary-key
+      config:
+        key: john-key
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: Consumer
+metadata:
+  namespace: aic
+  name: jane
+spec:
+  gatewayRef:
+    name: apisix
+  credentials:
+    - type: key-auth
+      name: primary-key
+      config:
+        key: jane-key
+---
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: limit-count-plugin-config
+spec:
+  plugins:
+    - name: key-auth
+      config:
+        _meta:
+          disable: false
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        key_type: var_combination
+        key: "$remote_addr $consumer_name"
+        policy: local
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: limit-count-route
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v2
+kind: ApisixConsumer
+metadata:
+  namespace: aic
+  name: john
+spec:
+  ingressClassName: apisix
+  authParameter:
+    keyAuth:
+      value:
+        key: john-key
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixConsumer
+metadata:
+  namespace: aic
+  name: jane
+spec:
+  ingressClassName: apisix
+  authParameter:
+    keyAuth:
+      value:
+        key: jane-key
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixUpstream
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  ingressClassName: apisix
+  externalNodes:
+  - type: Domain
+    name: httpbin.org
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixRoute
+metadata:
+  namespace: aic
+  name: limit-count-route
+spec:
+  ingressClassName: apisix
+  http:
+    - name: limit-count-route
+      match:
+        paths:
+          - /get
+      upstreams:
+      - name: httpbin-external-domain
+      plugins:
+      - name: key-auth
+        enable: true
+      - name: limit-count
+        enable: true
+        config:
+          count: 1
+          time_window: 30
+          rejected_code: 429
+          key_type: var_combination
+          key: "$remote_addr $consumer_name"
+          policy: local
+```
+
+</TabItem>
+
+</Tabs>
+
+Apply the configuration to your cluster:
+
+```shell
+kubectl apply -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+</Tabs>
+
 Send a request as the Consumer `jane`:
 
 ```shell
@@ -237,6 +645,17 @@ The following example demonstrates the sharing of rate 
limiting quota among mult
 
 Note that the configurations of the `limit-count` plugin of the same `group` 
should be identical. To avoid update anomalies and repetitive configurations, 
you can create a Service with `limit-count` plugin and Upstream for routes to 
connect to.
 
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
 Create a service:
 
 ```shell
@@ -249,6 +668,7 @@ curl "http://127.0.0.1:9180/apisix/admin/services"; -X PUT \
         "count": 1,
         "time_window": 30,
         "rejected_code": 429,
+        "policy": "local",
         "group": "srv1"
       }
     },
@@ -293,6 +713,202 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+Create a service with two routes that share the same rate limiting quota:
+
+```yaml title="adc.yaml"
+services:
+  - name: limit-count-service
+    plugins:
+      limit-count:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        policy: local
+        group: srv1
+    routes:
+      - name: limit-count-route-1
+        uris:
+          - /get1
+        plugins:
+          proxy-rewrite:
+            uri: /get
+      - name: limit-count-route-2
+        uris:
+          - /get2
+        plugins:
+          proxy-rewrite:
+            uri: /get
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+Synchronize the configuration to the gateway:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+Create two HTTPRoutes that reference the same PluginConfig to share quota:
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: limit-count-plugin-config
+spec:
+  plugins:
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        policy: local
+        group: srv1
+    - name: proxy-rewrite
+      config:
+        uri: /get
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: limit-count-route-1
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get1
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: limit-count-route-2
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get2
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+Create an ApisixRoute with multiple paths that share the same plugin 
configuration:
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v2
+kind: ApisixUpstream
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  ingressClassName: apisix
+  externalNodes:
+  - type: Domain
+    name: httpbin.org
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixRoute
+metadata:
+  namespace: aic
+  name: limit-count-shared-route
+spec:
+  ingressClassName: apisix
+  http:
+    - name: limit-count-shared
+      match:
+        paths:
+          - /get1
+          - /get2
+      upstreams:
+      - name: httpbin-external-domain
+      plugins:
+        - name: proxy-rewrite
+          enable: true
+          config:
+            uri: /get
+        - name: limit-count
+          enable: true
+          config:
+            count: 1
+            time_window: 30
+            rejected_code: 429
+            policy: local
+            group: srv1
+```
+
+</TabItem>
+
+</Tabs>
+
+Apply the configuration to your cluster:
+
+```shell
+kubectl apply -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+</Tabs>
+
 :::note
 
 The [`proxy-rewrite`](./proxy-rewrite.md) plugin is used to rewrite the URI to 
`/get` so that requests are forwarded to the correct endpoint.
@@ -321,6 +937,17 @@ The following example demonstrates the rate limiting of 
requests across multiple
 
 On each APISIX instance, create a Route with the following configurations. 
Adjust the address of the Admin API, Redis host, port, password, and database 
accordingly.
 
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
 ```shell
 curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   -H "X-API-KEY: ${admin_key}" \
@@ -349,6 +976,170 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+Create a route with Redis-based rate limiting. Set `policy` to `redis` to use 
a Redis instance for rate limiting. Configure the `redis_host`, `redis_port`, 
`redis_password`, and `redis_database` to match your Redis instance:
+
+```yaml title="adc.yaml"
+services:
+  - name: redis-limit-service
+    routes:
+      - name: redis-limit-route
+        uris:
+          - /get
+        plugins:
+          limit-count:
+            count: 1
+            time_window: 30
+            rejected_code: 429
+            key: remote_addr
+            policy: redis
+            redis_host: "192.168.xxx.xxx"
+            redis_port: 6379
+            redis_password: "p@ssw0rd"
+            redis_database: 1
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+Synchronize the configuration to the gateway:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: limit-count-redis-plugin-config
+spec:
+  plugins:
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        key: remote_addr
+        policy: redis
+        redis_host: "redis-service.aic.svc"
+        redis_port: 6379
+        redis_password: "p@ssw0rd"
+        redis_database: 1
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: redis-limit-route
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-redis-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v2
+kind: ApisixUpstream
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  ingressClassName: apisix
+  externalNodes:
+  - type: Domain
+    name: httpbin.org
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixRoute
+metadata:
+  namespace: aic
+  name: redis-limit-route
+spec:
+  ingressClassName: apisix
+  http:
+    - name: redis-limit-route
+      match:
+        paths:
+          - /get
+      upstreams:
+      - name: httpbin-external-domain
+      plugins:
+      - name: limit-count
+        enable: true
+        config:
+          count: 1
+          time_window: 30
+          rejected_code: 429
+          key: remote_addr
+          policy: redis
+          redis_host: "redis-service.aic.svc"
+          redis_port: 6379
+          redis_password: "p@ssw0rd"
+          redis_database: 1
+```
+
+</TabItem>
+
+</Tabs>
+
+Apply the configuration to your cluster:
+
+```shell
+kubectl apply -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+</Tabs>
+
 Send a request to an APISIX instance:
 
 ```shell
@@ -367,6 +1158,17 @@ Ensure that your Redis instances are running in [cluster 
mode](https://redis.io/
 
 On each APISIX instance, create a Route with the following configurations. 
Adjust the address of the Admin API, Redis cluster nodes, password, cluster 
name, and SSL varification accordingly.
 
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
 ```shell
 curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   -H "X-API-KEY: ${admin_key}" \
@@ -398,6 +1200,176 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+Create a route with Redis cluster-based rate limiting. Set `policy` to 
`redis-cluster` to use a Redis cluster for rate limiting. Configure 
`redis_cluster_nodes` with the Redis node addresses, `redis_password` with the 
cluster password, `redis_cluster_name` with the cluster name, and enable 
`redis_cluster_ssl` for SSL/TLS communication:
+
+```yaml title="adc.yaml"
+services:
+  - name: redis-cluster-limit-service
+    routes:
+      - name: redis-cluster-limit-route
+        uris:
+          - /get
+        plugins:
+          limit-count:
+            count: 1
+            time_window: 30
+            rejected_code: 429
+            key: remote_addr
+            policy: redis-cluster
+            redis_cluster_nodes:
+              - "192.168.xxx.xxx:6379"
+              - "192.168.xxx.xxx:16379"
+            redis_password: "p@ssw0rd"
+            redis_cluster_name: redis-cluster-1
+            redis_cluster_ssl: true
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+Synchronize the configuration to the gateway:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: limit-count-redis-cluster-plugin-config
+spec:
+  plugins:
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        key: remote_addr
+        policy: redis-cluster
+        redis_cluster_nodes:
+          - "redis-cluster-0.redis-cluster.aic.svc:6379"
+          - "redis-cluster-1.redis-cluster.aic.svc:6379"
+        redis_password: "p@ssw0rd"
+        redis_cluster_name: redis-cluster-1
+        redis_cluster_ssl: true
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: redis-cluster-limit-route
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-redis-cluster-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v2
+kind: ApisixUpstream
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  ingressClassName: apisix
+  externalNodes:
+  - type: Domain
+    name: httpbin.org
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixRoute
+metadata:
+  namespace: aic
+  name: redis-cluster-limit-route
+spec:
+  ingressClassName: apisix
+  http:
+    - name: redis-cluster-limit-route
+      match:
+        paths:
+          - /get
+      upstreams:
+      - name: httpbin-external-domain
+      plugins:
+      - name: limit-count
+        enable: true
+        config:
+          count: 1
+          time_window: 30
+          rejected_code: 429
+          key: remote_addr
+          policy: redis-cluster
+          redis_cluster_nodes:
+            - "redis-cluster-0.redis-cluster.aic.svc:6379"
+            - "redis-cluster-1.redis-cluster.aic.svc:6379"
+          redis_password: "p@ssw0rd"
+          redis_cluster_name: redis-cluster-1
+          redis_cluster_ssl: true
+```
+
+</TabItem>
+
+</Tabs>
+
+Apply the configuration to your cluster:
+
+```shell
+kubectl apply -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+</Tabs>
+
 Send a request to an APISIX instance:
 
 ```shell
@@ -410,7 +1382,18 @@ Send the same request to a different APISIX instance 
within the same 30-second t
 
 ### Rate Limit with Anonymous Consumer
 
-does not need to authenticate and has less quotas. While this example uses 
[`key-auth`](./key-auth.md) for authentication, the anonymous Consumer can also 
be configured with [`basic-auth`](./basic-auth.md), 
[`jwt-auth`](./jwt-auth.md), and [`hmac-auth`](./hmac-auth.md).
+The following example demonstrates how you can configure different rate 
limiting policies for regular and anonymous Consumers, where the anonymous 
Consumer does not need to authenticate and has less quota. While this example 
uses [`key-auth`](./key-auth.md) for authentication, the anonymous Consumer can 
also be configured with [`basic-auth`](./basic-auth.md), 
[`jwt-auth`](./jwt-auth.md), and [`hmac-auth`](./hmac-auth.md).
+
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
 
 Create a regular Consumer `john` and configure the `limit-count` plugin to 
allow for a quota of 3 within a 30-second window:
 
@@ -483,6 +1466,178 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+Configure consumers with different rate limits and a route that accepts 
anonymous users:
+
+```yaml title="adc.yaml"
+consumers:
+  - username: john
+    plugins:
+      limit-count:
+        count: 3
+        time_window: 30
+        rejected_code: 429
+        policy: local
+    credentials:
+      - name: key-auth
+        type: key-auth
+        config:
+          key: john-key
+  - username: anonymous
+    plugins:
+      limit-count:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        policy: local
+services:
+  - name: anonymous-rate-limit-service
+    routes:
+      - name: key-auth-route
+        uris:
+          - /anything
+        plugins:
+          key-auth:
+            anonymous_consumer: anonymous
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+Synchronize the configuration to the gateway:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+Configure consumers with different rate limits and a route that accepts 
anonymous users:
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v1alpha1
+kind: Consumer
+metadata:
+  namespace: aic
+  name: john
+spec:
+  gatewayRef:
+    name: apisix
+  credentials:
+    - type: key-auth
+      name: primary-key
+      config:
+        key: john-key
+  plugins:
+    - name: limit-count
+      config:
+        count: 3
+        time_window: 30
+        rejected_code: 429
+        policy: local
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: Consumer
+metadata:
+  namespace: aic
+  name: anonymous
+spec:
+  gatewayRef:
+    name: apisix
+  plugins:
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        policy: local
+---
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: key-auth-plugin-config
+spec:
+  plugins:
+    - name: key-auth
+      config:
+        anonymous_consumer: aic_anonymous  # namespace_consumername
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: key-auth-route
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /anything
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: key-auth-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+Apply the configuration to your cluster:
+
+```shell
+kubectl apply -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+:::important[note]
+
+The ApisixConsumer CRD currently does not support configuring plugins on 
consumers, except for the authentication plugins allowed in `authParameter`. 
This example cannot be completed with APISIX CRDs.
+
+:::
+
+</TabItem>
+
+</Tabs>
+
+</TabItem>
+
+</Tabs>
+
 To verify, send five consecutive requests with `john`'s key:
 
 ```shell
@@ -512,3 +1667,255 @@ You should see the following response, showing that only 
one request was success
 ```text
 200:    1, 429:    4
 ```
+
+### Customize Rate Limiting Headers
+
+The following example demonstrates how you can use Plugin metadata to 
customize the rate limiting response header names, which are by default 
`X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset`.
+
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
+Configure Plugin metadata to customize rate limiting headers:
+
+```shell
+curl "http://127.0.0.1:9180/apisix/admin/plugin_metadata/limit-count"; -X PUT \
+  -H "X-API-KEY: ${admin_key}" \
+  -d '{
+    "limit_header": "X-Custom-RateLimit-Limit",
+    "remaining_header": "X-Custom-RateLimit-Remaining",
+    "reset_header": "X-Custom-RateLimit-Reset"
+  }'
+```
+
+Create a Route with `limit-count` Plugin:
+
+```shell
+curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
+  -H "X-API-KEY: ${admin_key}" \
+  -d '{
+    "id": "limit-count-route",
+    "uri": "/get",
+    "plugins": {
+      "limit-count": {
+        "count": 1,
+        "time_window": 30,
+        "rejected_code": 429,
+        "key_type": "var",
+        "key": "remote_addr"
+      }
+    },
+    "upstream": {
+      "type": "roundrobin",
+      "nodes": {
+        "httpbin.org:80": 1
+      }
+    }
+  }'
+```
+
+</TabItem>
+
+<TabItem value="adc">
+
+Configure plugin metadata and create a route with rate limiting:
+
+```yaml title="adc.yaml"
+plugin_metadata:
+  limit-count:
+    limit_header: X-Custom-RateLimit-Limit
+    remaining_header: X-Custom-RateLimit-Remaining
+    reset_header: X-Custom-RateLimit-Reset
+services:
+  - name: limit-count-service
+    routes:
+      - name: limit-count-route
+        uris:
+          - /get
+        plugins:
+          limit-count:
+            count: 1
+            time_window: 30
+            rejected_code: 429
+            key_type: var
+            key: remote_addr
+            policy: local
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+Synchronize the configuration to the gateway:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+Update your GatewayProxy manifest for the plugin metadata:
+
+```yaml title="gatewayproxy.yaml"
+apiVersion: apisix.apache.org/v1alpha1
+kind: GatewayProxy
+metadata:
+  namespace: aic
+  name: apisix-config
+spec:
+  provider:
+    type: ControlPlane
+    controlPlane:
+      # ...
+      # your control plane connection configuration
+  pluginMetadata:
+    limit-count:
+      limit_header: X-Custom-RateLimit-Limit
+      remaining_header: X-Custom-RateLimit-Remaining
+      reset_header: X-Custom-RateLimit-Reset
+```
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+Create a route with the plugin enabled:
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: limit-count-plugin-config
+spec:
+  plugins:
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        key_type: var
+        key: remote_addr
+        policy: local
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: limit-count-route
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+Create a route with the plugin enabled:
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v2
+kind: ApisixUpstream
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  ingressClassName: apisix
+  externalNodes:
+  - type: Domain
+    name: httpbin.org
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixRoute
+metadata:
+  namespace: aic
+  name: limit-count-route
+spec:
+  ingressClassName: apisix
+  http:
+    - name: limit-count-route
+      match:
+        paths:
+          - /get
+      upstreams:
+      - name: httpbin-external-domain
+      plugins:
+      - name: limit-count
+        enable: true
+        config:
+          count: 1
+          time_window: 30
+          rejected_code: 429
+          key_type: var
+          key: remote_addr
+          policy: local
+```
+
+</TabItem>
+
+</Tabs>
+
+Apply the configuration to your cluster:
+
+```shell
+kubectl apply -f gatewayproxy.yaml -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+</Tabs>
+
+Send a request to verify:
+
+```shell
+curl -i "http://127.0.0.1:9080/get";
+```
+
+You should receive an `HTTP/1.1 200 OK` response and see the following headers:
+
+```text
+X-Custom-RateLimit-Limit: 1
+X-Custom-RateLimit-Remaining: 0
+X-Custom-RateLimit-Reset: 28
+```
diff --git a/docs/zh/latest/plugins/limit-count.md 
b/docs/zh/latest/plugins/limit-count.md
index 65ac820e2..bb5108b73 100644
--- a/docs/zh/latest/plugins/limit-count.md
+++ b/docs/zh/latest/plugins/limit-count.md
@@ -31,11 +31,14 @@ description: limit-count 插件使用固定窗口算法,通过给定时间间
   <link rel="canonical" href="https://docs.api7.ai/hub/limit-count"; />
 </head>
 
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
 ## 描述
 
 `limit-count` 插件使用固定窗口算法,通过给定时间间隔内的请求数量来限制请求速率。超过配置配额的请求将被拒绝。
 
-您可能会在响应中看到以下速率限制标头:
+你可能会在响应中看到以下速率限制标头:
 
 * `X-RateLimit-Limit`:总配额
 * `X-RateLimit-Remaining`:剩余配额
@@ -45,11 +48,11 @@ description: limit-count 插件使用固定窗口算法,通过给定时间间
 
 | 名称                | 类型    | 必选项      | 默认值        | 有效值                      
             | 描述                                                               
                                                                                
                                                                                
  |
 | ------------------- | ------- | ---------- | ------------- | 
--------------------------------------- | 
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 |
-| count | integer | 否 | | > 0 | 给定时间间隔内允许的最大请求数。如果未配置 `rules`,则此项必填。 |
-| time_window | integer | 否 | | > 0 | 速率限制 `count` 对应的时间间隔(以秒为单位)。如果未配置 
`rules`,则此项必填。 |
+| count | integer 或 string | 否 | | > 0 | 给定时间间隔内允许的最大请求数。如果未配置 
`rules`,则此项必填。支持从 APISIX 3.16.0 起使用 
[lua-resty-expr](https://github.com/api7/lua-resty-expr)。 |
+| time_window | integer 或 string | 否 | | > 0 | 速率限制 `count` 
对应的时间间隔(以秒为单位)。如果未配置 `rules`,则此项必填。支持从 APISIX 3.16.0 起使用 
[lua-resty-expr](https://github.com/api7/lua-resty-expr)。 |
 | rules | array[object] | 否 | | | 速率限制规则列表。每个规则是一个包含 `count`、`time_window` 和 
`key` 的对象。如果配置了 `rules`,则顶层的 `count` 和 `time_window` 将被忽略。 |
-| rules.count | integer | 是 | | > 0 | 给定时间间隔内允许的最大请求数。 |
-| rules.time_window | integer | 是 | | > 0 | 速率限制 `count` 对应的时间间隔(以秒为单位)。 |
+| rules.count | integer 或 string | 是 | | > 0 | 给定时间间隔内允许的最大请求数。支持 
[lua-resty-expr](https://github.com/api7/lua-resty-expr)。 |
+| rules.time_window | integer 或 string | 是 | | > 0 | 速率限制 `count` 
对应的时间间隔(以秒为单位)。支持 [lua-resty-expr](https://github.com/api7/lua-resty-expr)。 |
 | rules.key | string | 是 | | | 用于统计请求的键。如果配置的键不存在,则不会执行该规则。`key` 
被解释为变量的组合,例如:`$http_custom_a $http_custom_b`。|
 | rules.header_prefix | string | 否 | | | 速率限制标头的前缀。如果已配置,响应将包含 
`X-{header_prefix}-RateLimit-Limit`、`X-{header_prefix}-RateLimit-Remaining` 和 
`X-{header_prefix}-RateLimit-Reset` 标头。如果未配置,则使用规则数组中规则的索引作为前缀。例如,第一个规则的标头将是 
`X-1-RateLimit-Limit`、`X-1-RateLimit-Remaining` 和 `X-1-RateLimit-Reset`。|
 | key_type | string | 否 | var | ["var","var_combination","constant"] | key 
的类型。如果`key_type` 为 `var`,则 `key` 将被解释为变量。如果 `key_type` 为 `var_combination`,则 
`key` 将被解释为变量的组合。如果 `key_type` 为 `constant`,则 `key` 将被解释为常量。 |
@@ -70,8 +73,8 @@ description: limit-count 插件使用固定窗口算法,通过给定时间间
 | redis_timeout | integer | 否 | 1000 | [1,...] | 当 `policy` 为 `redis` 或 
`redis-cluster` 时,Redis 超时值(以毫秒为单位)。 |
 | redis_keepalive_timeout | integer | 否 | 10000 | ≥ 1000 | 当 `policy` 为 
`redis` 或 `redis-cluster` 时,与 `redis` 或 `redis-cluster` 的空闲连接超时时间,单位为毫秒。|
 | redis_keepalive_pool | integer | 否 | 100 | ≥ 1 | 当 `policy` 为 `redis` 或 
`redis-cluster` 时,与 `redis` 或 `redis-cluster` 的连接池最大连接数。|
-| redis_cluster_nodes | array[string] | 否 | | | 具有至少两个地址的 Redis 群集节点列表。当 
policy 为 redis-cluster 时必填。 |
-redis_cluster_name | string | 否 | | | | Redis 集群的名称。当 `policy` 为 
`redis-cluster` 时必须使用。|
+| redis_cluster_nodes | array[string] | 否 | | | 具有至少一个地址的 Redis 群集节点列表。当 
policy 为 redis-cluster 时必填。 |
+| redis_cluster_name | string | 否 | | | Redis 集群的名称。当 `policy` 为 
`redis-cluster` 时必须使用。|
 | redis_cluster_ssl | boolean | 否 | false | | 如果为 `true`,当 `policy` 为 
`redis-cluster`时,使用 SSL 连接 Redis 集群。|
 | redis_cluster_ssl_verify | boolean | 否 | false | | 如果为 `true`,当 `policy` 为 
`redis-cluster` 时,验证服务器 SSL 证书。  |
 
@@ -81,7 +84,7 @@ redis_cluster_name | string | 否 | | | | Redis 集群的名称。当 
`policy` 
 
 :::note
 
-您可以这样从 `config.yaml` 中获取 `admin_key` 并存入环境变量:
+你可以这样从 `config.yaml` 中获取 `admin_key` 并存入环境变量:
 
 ```bash
 admin_key=$(yq '.deployment.admin.admin_key[0].key' conf/config.yaml | sed 
's/"//g')
@@ -95,6 +98,17 @@ admin_key=$(yq '.deployment.admin.admin_key[0].key' 
conf/config.yaml | sed 's/"/
 
 创建一个带有 `limit-count` 插件的路由,允许在 30 秒窗口内为每个远程地址设置 1 个配额:
 
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
 ```shell
 curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   -H "X-API-KEY: ${admin_key}" \
@@ -107,7 +121,8 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
         "time_window": 30,
         "rejected_code": 429,
         "key_type": "var",
-        "key": "remote_addr"
+        "key": "remote_addr",
+        "policy": "local"
       }
     },
     "upstream": {
@@ -119,20 +134,184 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+```yaml title="adc.yaml"
+services:
+  - name: httpbin
+    routes:
+      - uris:
+          - /get
+        name: limit-count-route
+        plugins:
+          limit-count:
+            count: 1
+            time_window: 30
+            rejected_code: 429
+            key_type: var
+            key: remote_addr
+            policy: local
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+将配置同步到网关:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: limit-count-plugin-config
+spec:
+  plugins:
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        key_type: var
+        key: remote_addr
+        policy: local
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: limit-count-route
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v2
+kind: ApisixUpstream
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  ingressClassName: apisix
+  externalNodes:
+  - type: Domain
+    name: httpbin.org
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixRoute
+metadata:
+  namespace: aic
+  name: limit-count-route
+spec:
+  ingressClassName: apisix
+  http:
+    - name: limit-count-route
+      match:
+        paths:
+          - /get
+      upstreams:
+      - name: httpbin-external-domain
+      plugins:
+      - name: limit-count
+        enable: true
+        config:
+          count: 1
+          time_window: 30
+          rejected_code: 429
+          key_type: var
+          key: remote_addr
+          policy: local
+```
+
+</TabItem>
+
+</Tabs>
+
+将配置应用到集群:
+
+```shell
+kubectl apply -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+</Tabs>
+
 发送验证请求:
 
 ```shell
 curl -i "http://127.0.0.1:9080/get";
 ```
 
-您应该会看到 `HTTP/1.1 200 OK` 响应。
+你应该会看到 `HTTP/1.1 200 OK` 响应。
 
-该请求已消耗了时间窗口允许的所有配额。如果您在相同的 30 秒时间间隔内再次发送该请求,您应该会收到 `HTTP/1.1 429 Too Many 
Requests` 响应,表示该请求超出了配额阈值。
+该请求已消耗了时间窗口允许的所有配额。如果你在相同的 30 秒时间间隔内再次发送该请求,你应该会收到 `HTTP/1.1 429 Too Many 
Requests` 响应,表示该请求超出了配额阈值。
 
 ### 通过远程地址和消费者名称应用速率限制
 
 以下示例演示了通过变量 `remote_addr` 和 `consumer_name` 的组合对请求进行速率限制。它允许每个远程地址和每个消费者在 30 
秒窗口内有 1 个配额。
 
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
 创建消费者 `john`:
 
 ```shell
@@ -183,7 +362,7 @@ curl 
"http://127.0.0.1:9180/apisix/admin/consumers/jane/credentials"; -X PUT \
   }'
 ```
 
-创建一个带有 `key-auth` 和 `limit-count` 插件的路由,并在 `limit-count` 插件中指定使用变量组合作为速率限制键:
+创建一个带有 `key-auth` 和 `limit-count` 插件的路由,并在 `limit-count` 
插件中指定使用变量组合作为速率限制键。`key-auth` 插件在路由上启用密钥认证。`key_type` 设置为 `var_combination` 以将 
`key` 解释为变量的组合,`key` 设置为 `$remote_addr $consumer_name` 以按远程地址和每个消费者应用速率限制配额:
 
 ```shell
 curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
@@ -210,15 +389,244 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+创建两个消费者和一个按消费者启用速率限制的路由。`key-auth` 插件在路由上启用密钥认证。`key_type` 设置为 
`var_combination` 以将 `key` 解释为变量的组合,`key` 设置为 `$remote_addr $consumer_name` 
以按远程地址和每个消费者应用速率限制配额:
+
+```yaml title="adc.yaml"
+consumers:
+  - username: john
+    credentials:
+      - name: key-auth
+        type: key-auth
+        config:
+          key: john-key
+  - username: jane
+    credentials:
+      - name: key-auth
+        type: key-auth
+        config:
+          key: jane-key
+services:
+  - name: limit-count-service
+    routes:
+      - name: limit-count-route
+        uris:
+          - /get
+        plugins:
+          key-auth: {}
+          limit-count:
+            count: 1
+            time_window: 30
+            rejected_code: 429
+            key_type: var_combination
+            key: "$remote_addr $consumer_name"
+            policy: local
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+将配置同步到网关:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+创建两个消费者和一个按消费者启用速率限制的路由。`key-auth` 插件在路由上启用密钥认证。`key_type` 设置为 
`var_combination` 以将 `key` 解释为变量的组合,`key` 设置为 `$remote_addr $consumer_name` 
以按远程地址和每个消费者应用速率限制配额:
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v1alpha1
+kind: Consumer
+metadata:
+  namespace: aic
+  name: john
+spec:
+  gatewayRef:
+    name: apisix
+  credentials:
+    - type: key-auth
+      name: primary-key
+      config:
+        key: john-key
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: Consumer
+metadata:
+  namespace: aic
+  name: jane
+spec:
+  gatewayRef:
+    name: apisix
+  credentials:
+    - type: key-auth
+      name: primary-key
+      config:
+        key: jane-key
+---
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: limit-count-plugin-config
+spec:
+  plugins:
+    - name: key-auth
+      config:
+        _meta:
+          disable: false
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        key_type: var_combination
+        key: "$remote_addr $consumer_name"
+        policy: local
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: limit-count-route
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v2
+kind: ApisixConsumer
+metadata:
+  namespace: aic
+  name: john
+spec:
+  ingressClassName: apisix
+  authParameter:
+    keyAuth:
+      value:
+        key: john-key
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixConsumer
+metadata:
+  namespace: aic
+  name: jane
+spec:
+  ingressClassName: apisix
+  authParameter:
+    keyAuth:
+      value:
+        key: jane-key
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixUpstream
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  ingressClassName: apisix
+  externalNodes:
+  - type: Domain
+    name: httpbin.org
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixRoute
+metadata:
+  namespace: aic
+  name: limit-count-route
+spec:
+  ingressClassName: apisix
+  http:
+    - name: limit-count-route
+      match:
+        paths:
+          - /get
+      upstreams:
+      - name: httpbin-external-domain
+      plugins:
+      - name: key-auth
+        enable: true
+      - name: limit-count
+        enable: true
+        config:
+          count: 1
+          time_window: 30
+          rejected_code: 429
+          key_type: var_combination
+          key: "$remote_addr $consumer_name"
+          policy: local
+```
+
+</TabItem>
+
+</Tabs>
+
+将配置应用到集群:
+
+```shell
+kubectl apply -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+</Tabs>
+
 以消费者 `jane` 的身份发送请求:
 
 ```shell
 curl -i "http://127.0.0.1:9080/get"; -H 'apikey: jane-key'
 ```
 
-您应该会看到一个 `HTTP/1.1 200 OK` 响应以及相应的响应主体。
+你应该会看到一个 `HTTP/1.1 200 OK` 响应以及相应的响应主体。
 
-此请求已消耗了为时间窗口设置的所有配额。如果您在相同的 30 秒时间间隔内向消费者 `jane` 发送相同的请求,您应该会收到一个 `HTTP/1.1 
429 Too Many Requests` 响应,表示请求超出了配额阈值。
+此请求已消耗了为时间窗口设置的所有配额。如果你在相同的 30 秒时间间隔内向消费者 `jane` 发送相同的请求,你应该会收到一个 `HTTP/1.1 
429 Too Many Requests` 响应,表示请求超出了配额阈值。
 
 在相同的 30 秒时间间隔内向消费者 `john` 发送相同的请求:
 
@@ -226,9 +634,9 @@ curl -i "http://127.0.0.1:9080/get"; -H 'apikey: jane-key'
 curl -i "http://127.0.0.1:9080/get"; -H 'apikey: john-key'
 ```
 
-您应该看到一个 `HTTP/1.1 200 OK` 响应和相应的响应主体,表明请求不受速率限制。
+你应该看到一个 `HTTP/1.1 200 OK` 响应和相应的响应主体,表明请求不受速率限制。
 
-在相同的 30 秒时间间隔内再次以消费者 `john` 的身份发送相同的请求,您应该收到一个 `HTTP/1.1 429 Too Many 
Requests` 响应。
+在相同的 30 秒时间间隔内再次以消费者 `john` 的身份发送相同的请求,你应该收到一个 `HTTP/1.1 429 Too Many 
Requests` 响应。
 
 这通过变量 `remote_addr` 和 `consumer_name` 的组合验证了插件速率限制。
 
@@ -236,7 +644,18 @@ curl -i "http://127.0.0.1:9080/get"; -H 'apikey: john-key'
 
 以下示例通过配置 `limit-count` 插件的 `group` 演示了在多个路由之间共享速率限制配额。
 
-请注意,同一 `group` 的 `limit-count` 插件的配置应该相同。为了避免更新异常和重复配置,您可以创建一个带有 `limit-count` 
插件和上游的服务,以供路由连接。
+请注意,同一 `group` 的 `limit-count` 插件的配置应该相同。为了避免更新异常和重复配置,你可以创建一个带有 `limit-count` 
插件和上游的服务,以供路由连接。
+
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
 
 创建服务:
 
@@ -250,6 +669,7 @@ curl "http://127.0.0.1:9180/apisix/admin/services"; -X PUT \
         "count": 1,
         "time_window": 30,
         "rejected_code": 429,
+        "policy": "local",
         "group": "srv1"
       }
     },
@@ -294,6 +714,202 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+创建一个带有两个路由的服务,共享相同的速率限制配额:
+
+```yaml title="adc.yaml"
+services:
+  - name: limit-count-service
+    plugins:
+      limit-count:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        policy: local
+        group: srv1
+    routes:
+      - name: limit-count-route-1
+        uris:
+          - /get1
+        plugins:
+          proxy-rewrite:
+            uri: /get
+      - name: limit-count-route-2
+        uris:
+          - /get2
+        plugins:
+          proxy-rewrite:
+            uri: /get
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+将配置同步到网关:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+创建两个引用相同 PluginConfig 的 HTTPRoute 以共享配额:
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: limit-count-plugin-config
+spec:
+  plugins:
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        policy: local
+        group: srv1
+    - name: proxy-rewrite
+      config:
+        uri: /get
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: limit-count-route-1
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get1
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: limit-count-route-2
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get2
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+创建一个包含多个路径的 ApisixRoute,共享相同的插件配置:
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v2
+kind: ApisixUpstream
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  ingressClassName: apisix
+  externalNodes:
+  - type: Domain
+    name: httpbin.org
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixRoute
+metadata:
+  namespace: aic
+  name: limit-count-shared-route
+spec:
+  ingressClassName: apisix
+  http:
+    - name: limit-count-shared
+      match:
+        paths:
+          - /get1
+          - /get2
+      upstreams:
+      - name: httpbin-external-domain
+      plugins:
+        - name: proxy-rewrite
+          enable: true
+          config:
+            uri: /get
+        - name: limit-count
+          enable: true
+          config:
+            count: 1
+            time_window: 30
+            rejected_code: 429
+            policy: local
+            group: srv1
+```
+
+</TabItem>
+
+</Tabs>
+
+将配置应用到集群:
+
+```shell
+kubectl apply -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+</Tabs>
+
 :::note
 
 [`proxy-rewrite`](./proxy-rewrite.md) 插件用于将 URI 重写为 `/get`,以便将请求转发到正确的端点。
@@ -306,7 +922,7 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
 curl -i "http://127.0.0.1:9080/get1";
 ```
 
-您应该会看到一个 `HTTP/1.1 200 OK` 响应以及相应的响应主体。
+你应该会看到一个 `HTTP/1.1 200 OK` 响应以及相应的响应主体。
 
 在相同的 30 秒时间间隔内向路由 `/get2` 发送相同的请求:
 
@@ -314,7 +930,7 @@ curl -i "http://127.0.0.1:9080/get1";
 curl -i "http://127.0.0.1:9080/get2";
 ```
 
-您应该收到 `HTTP/1.1 429 Too Many Requests` 响应,这验证两个路由共享相同的速率限制配额。
+你应该收到 `HTTP/1.1 429 Too Many Requests` 响应,这验证两个路由共享相同的速率限制配额。
 
 ### 使用 Redis 服务器在 APISIX 节点之间共享配额
 
@@ -322,6 +938,17 @@ curl -i "http://127.0.0.1:9080/get2";
 
 在每个 APISIX 实例上,使用以下配置创建一个路由。相应地调整管理 API 的地址、Redis 主机、端口、密码和数据库。
 
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
 ```shell
 curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   -H "X-API-KEY: ${admin_key}" \
@@ -350,24 +977,199 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+创建一个使用 Redis 进行速率限制的路由。将 `policy` 设置为 `redis` 以使用 Redis 实例进行速率限制。配置 
`redis_host`、`redis_port`、`redis_password` 和 `redis_database` 以匹配你的 Redis 实例:
+
+```yaml title="adc.yaml"
+services:
+  - name: redis-limit-service
+    routes:
+      - name: redis-limit-route
+        uris:
+          - /get
+        plugins:
+          limit-count:
+            count: 1
+            time_window: 30
+            rejected_code: 429
+            key: remote_addr
+            policy: redis
+            redis_host: "192.168.xxx.xxx"
+            redis_port: 6379
+            redis_password: "p@ssw0rd"
+            redis_database: 1
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+将配置同步到网关:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: limit-count-redis-plugin-config
+spec:
+  plugins:
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        key: remote_addr
+        policy: redis
+        redis_host: "redis-service.aic.svc"
+        redis_port: 6379
+        redis_password: "p@ssw0rd"
+        redis_database: 1
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: redis-limit-route
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-redis-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v2
+kind: ApisixUpstream
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  ingressClassName: apisix
+  externalNodes:
+  - type: Domain
+    name: httpbin.org
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixRoute
+metadata:
+  namespace: aic
+  name: redis-limit-route
+spec:
+  ingressClassName: apisix
+  http:
+    - name: redis-limit-route
+      match:
+        paths:
+          - /get
+      upstreams:
+      - name: httpbin-external-domain
+      plugins:
+      - name: limit-count
+        enable: true
+        config:
+          count: 1
+          time_window: 30
+          rejected_code: 429
+          key: remote_addr
+          policy: redis
+          redis_host: "redis-service.aic.svc"
+          redis_port: 6379
+          redis_password: "p@ssw0rd"
+          redis_database: 1
+```
+
+</TabItem>
+
+</Tabs>
+
+将配置应用到集群:
+
+```shell
+kubectl apply -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+</Tabs>
+
 向 APISIX 实例发送请求:
 
 ```shell
 curl -i "http://127.0.0.1:9080/get";
 ```
 
-您应该会看到一个 `HTTP/1.1 200 OK` 响应以及相应的响应主体。
+你应该会看到一个 `HTTP/1.1 200 OK` 响应以及相应的响应主体。
 
-在相同的 30 秒时间间隔内向不同的 APISIX 实例发送相同的请求,您应该会收到一个 `HTTP/1.1 429 Too Many Requests` 
响应,验证在不同 APISIX 节点中配置的路由是否共享相同的配额。
+在相同的 30 秒时间间隔内向不同的 APISIX 实例发送相同的请求,你应该会收到一个 `HTTP/1.1 429 Too Many Requests` 
响应,验证在不同 APISIX 节点中配置的路由是否共享相同的配额。
 
 ### 使用 Redis 集群在 APISIX 节点之间共享配额
 
-您还可以使用 Redis 集群在多个 APISIX 节点之间应用相同的配额,以便不同的 APISIX 节点共享相同的速率限制配额。
+你还可以使用 Redis 集群在多个 APISIX 节点之间应用相同的配额,以便不同的 APISIX 节点共享相同的速率限制配额。
 
-确保您的 Redis 实例在 
[集群模式](https://redis.io/docs/management/scaling/#create-and-use-a-redis-cluster)
 下运行。`limit-count` 插件配置至少需要两个节点。
+确保你的 Redis 实例在 
[集群模式](https://redis.io/docs/management/scaling/#create-and-use-a-redis-cluster)
 下运行。`limit-count` 插件配置至少需要两个节点。
 
 在每个 APISIX 实例上,使用以下配置创建路由。相应地调整管理 API 的地址、Redis 集群节点、密码、集群名称和 SSL 验证。
 
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
 ```shell
 curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   -H "X-API-KEY: ${admin_key}" \
@@ -399,20 +1201,201 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT 
\
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+创建一个使用 Redis 集群进行速率限制的路由。将 `policy` 设置为 `redis-cluster` 以使用 Redis 集群进行速率限制。配置 
`redis_cluster_nodes` 为 Redis 节点地址,`redis_password` 为集群密码,`redis_cluster_name` 
为集群名称,并启用 `redis_cluster_ssl` 以进行 SSL/TLS 通信:
+
+```yaml title="adc.yaml"
+services:
+  - name: redis-cluster-limit-service
+    routes:
+      - name: redis-cluster-limit-route
+        uris:
+          - /get
+        plugins:
+          limit-count:
+            count: 1
+            time_window: 30
+            rejected_code: 429
+            key: remote_addr
+            policy: redis-cluster
+            redis_cluster_nodes:
+              - "192.168.xxx.xxx:6379"
+              - "192.168.xxx.xxx:16379"
+            redis_password: "p@ssw0rd"
+            redis_cluster_name: redis-cluster-1
+            redis_cluster_ssl: true
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+将配置同步到网关:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: limit-count-redis-cluster-plugin-config
+spec:
+  plugins:
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        key: remote_addr
+        policy: redis-cluster
+        redis_cluster_nodes:
+          - "redis-cluster-0.redis-cluster.aic.svc:6379"
+          - "redis-cluster-1.redis-cluster.aic.svc:6379"
+        redis_password: "p@ssw0rd"
+        redis_cluster_name: redis-cluster-1
+        redis_cluster_ssl: true
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: redis-cluster-limit-route
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-redis-cluster-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v2
+kind: ApisixUpstream
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  ingressClassName: apisix
+  externalNodes:
+  - type: Domain
+    name: httpbin.org
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixRoute
+metadata:
+  namespace: aic
+  name: redis-cluster-limit-route
+spec:
+  ingressClassName: apisix
+  http:
+    - name: redis-cluster-limit-route
+      match:
+        paths:
+          - /get
+      upstreams:
+      - name: httpbin-external-domain
+      plugins:
+      - name: limit-count
+        enable: true
+        config:
+          count: 1
+          time_window: 30
+          rejected_code: 429
+          key: remote_addr
+          policy: redis-cluster
+          redis_cluster_nodes:
+            - "redis-cluster-0.redis-cluster.aic.svc:6379"
+            - "redis-cluster-1.redis-cluster.aic.svc:6379"
+          redis_password: "p@ssw0rd"
+          redis_cluster_name: redis-cluster-1
+          redis_cluster_ssl: true
+```
+
+</TabItem>
+
+</Tabs>
+
+将配置应用到集群:
+
+```shell
+kubectl apply -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+</Tabs>
+
 向 APISIX 实例发送请求:
 
 ```shell
 curl -i "http://127.0.0.1:9080/get";
 ```
 
-您应该会看到一个 `HTTP/1.1 200 OK` 响应以及相应的响应主体。
+你应该会看到一个 `HTTP/1.1 200 OK` 响应以及相应的响应主体。
 
-在相同的 30 秒时间间隔内向不同的 APISIX 实例发送相同的请求,您应该会收到一个 `HTTP/1.1 429 Too Many Requests` 
响应,验证在不同 APISIX 节点中配置的路由是否共享相同的配额。
+在相同的 30 秒时间间隔内向不同的 APISIX 实例发送相同的请求,你应该会收到一个 `HTTP/1.1 429 Too Many Requests` 
响应,验证在不同 APISIX 节点中配置的路由是否共享相同的配额。
 
 ### 使用匿名消费者进行速率限制
 
 以下示例演示了如何为常规和匿名消费者配置不同的速率限制策略,其中匿名消费者不需要进行身份验证并且配额较少。虽然此示例使用 
[`key-auth`](./key-auth.md) 进行身份验证,但匿名消费者也可以使用 
[`basic-auth`](./basic-auth.md)、[`jwt-auth`](./jwt-auth.md) 和 
[`hmac-auth`](./hmac-auth.md) 进行配置。
 
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
 创建一个消费者 `john`,并配置 `limit-count` 插件,以允许 30 秒内配额为 3:
 
 ```shell
@@ -484,6 +1467,178 @@ curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+配置具有不同速率限制的消费者和接受匿名用户的路由:
+
+```yaml title="adc.yaml"
+consumers:
+  - username: john
+    plugins:
+      limit-count:
+        count: 3
+        time_window: 30
+        rejected_code: 429
+        policy: local
+    credentials:
+      - name: key-auth
+        type: key-auth
+        config:
+          key: john-key
+  - username: anonymous
+    plugins:
+      limit-count:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        policy: local
+services:
+  - name: anonymous-rate-limit-service
+    routes:
+      - name: key-auth-route
+        uris:
+          - /anything
+        plugins:
+          key-auth:
+            anonymous_consumer: anonymous
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+将配置同步到网关:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+配置具有不同速率限制的消费者和接受匿名用户的路由:
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v1alpha1
+kind: Consumer
+metadata:
+  namespace: aic
+  name: john
+spec:
+  gatewayRef:
+    name: apisix
+  credentials:
+    - type: key-auth
+      name: primary-key
+      config:
+        key: john-key
+  plugins:
+    - name: limit-count
+      config:
+        count: 3
+        time_window: 30
+        rejected_code: 429
+        policy: local
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: Consumer
+metadata:
+  namespace: aic
+  name: anonymous
+spec:
+  gatewayRef:
+    name: apisix
+  plugins:
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        policy: local
+---
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: key-auth-plugin-config
+spec:
+  plugins:
+    - name: key-auth
+      config:
+        anonymous_consumer: aic_anonymous  # namespace_consumername
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: key-auth-route
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /anything
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: key-auth-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+将配置应用到集群:
+
+```shell
+kubectl apply -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+:::important[note]
+
+ApisixConsumer CRD 目前不支持在消费者上配置插件,除了 `authParameter` 中允许的认证插件。此示例无法使用 APISIX 
CRD 完成。
+
+:::
+
+</TabItem>
+
+</Tabs>
+
+</TabItem>
+
+</Tabs>
+
 使用 `john` 的密钥发送五个连续的请求:
 
 ```shell
@@ -493,7 +1648,7 @@ resp=$(seq 5 | xargs -I{} curl 
"http://127.0.0.1:9080/anything"; -H 'apikey: john
   echo "200": $count_200, "429": $count_429
 ```
 
-您应该看到以下响应,显示在 5 个请求中,3 个请求成功(状态代码 200),而其他请求被拒绝(状态代码 429)。
+你应该看到以下响应,显示在 5 个请求中,3 个请求成功(状态代码 200),而其他请求被拒绝(状态代码 429)。
 
 ```text
 200:    3, 429:    2
@@ -508,8 +1663,260 @@ resp=$(seq 5 | xargs -I{} curl 
"http://127.0.0.1:9080/anything"; -o /dev/null -s
   echo "200": $count_200, "429": $count_429
 ```
 
-您应该看到以下响应,表明只有一个请求成功:
+你应该看到以下响应,表明只有一个请求成功:
 
 ```text
 200:    1, 429:    4
 ```
+
+### 自定义速率限制标头
+
+以下示例演示了如何使用插件元数据自定义速率限制响应标头名称,默认名称为 
`X-RateLimit-Limit`、`X-RateLimit-Remaining` 和 `X-RateLimit-Reset`。
+
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
+配置插件元数据以自定义速率限制标头:
+
+```shell
+curl "http://127.0.0.1:9180/apisix/admin/plugin_metadata/limit-count"; -X PUT \
+  -H "X-API-KEY: ${admin_key}" \
+  -d '{
+    "limit_header": "X-Custom-RateLimit-Limit",
+    "remaining_header": "X-Custom-RateLimit-Remaining",
+    "reset_header": "X-Custom-RateLimit-Reset"
+  }'
+```
+
+创建带有 `limit-count` 插件的路由:
+
+```shell
+curl "http://127.0.0.1:9180/apisix/admin/routes"; -X PUT \
+  -H "X-API-KEY: ${admin_key}" \
+  -d '{
+    "id": "limit-count-route",
+    "uri": "/get",
+    "plugins": {
+      "limit-count": {
+        "count": 1,
+        "time_window": 30,
+        "rejected_code": 429,
+        "key_type": "var",
+        "key": "remote_addr"
+      }
+    },
+    "upstream": {
+      "type": "roundrobin",
+      "nodes": {
+        "httpbin.org:80": 1
+      }
+    }
+  }'
+```
+
+</TabItem>
+
+<TabItem value="adc">
+
+配置插件元数据并创建带有速率限制的路由:
+
+```yaml title="adc.yaml"
+plugin_metadata:
+  limit-count:
+    limit_header: X-Custom-RateLimit-Limit
+    remaining_header: X-Custom-RateLimit-Remaining
+    reset_header: X-Custom-RateLimit-Reset
+services:
+  - name: limit-count-service
+    routes:
+      - name: limit-count-route
+        uris:
+          - /get
+        plugins:
+          limit-count:
+            count: 1
+            time_window: 30
+            rejected_code: 429
+            key_type: var
+            key: remote_addr
+            policy: local
+    upstream:
+      type: roundrobin
+      nodes:
+        - host: httpbin.org
+          port: 80
+          weight: 1
+```
+
+将配置同步到网关:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+更新你的 GatewayProxy 清单以配置插件元数据:
+
+```yaml title="gatewayproxy.yaml"
+apiVersion: apisix.apache.org/v1alpha1
+kind: GatewayProxy
+metadata:
+  namespace: aic
+  name: apisix-config
+spec:
+  provider:
+    type: ControlPlane
+    controlPlane:
+      # ...
+      # 你的控制平面连接配置
+  pluginMetadata:
+    limit-count:
+      limit_header: X-Custom-RateLimit-Limit
+      remaining_header: X-Custom-RateLimit-Remaining
+      reset_header: X-Custom-RateLimit-Reset
+```
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+创建启用插件的路由:
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  type: ExternalName
+  externalName: httpbin.org
+---
+apiVersion: apisix.apache.org/v1alpha1
+kind: PluginConfig
+metadata:
+  namespace: aic
+  name: limit-count-plugin-config
+spec:
+  plugins:
+    - name: limit-count
+      config:
+        count: 1
+        time_window: 30
+        rejected_code: 429
+        key_type: var
+        key: remote_addr
+        policy: local
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  namespace: aic
+  name: limit-count-route
+spec:
+  parentRefs:
+    - name: apisix
+  rules:
+    - matches:
+        - path:
+            type: Exact
+            value: /get
+      filters:
+        - type: ExtensionRef
+          extensionRef:
+            group: apisix.apache.org
+            kind: PluginConfig
+            name: limit-count-plugin-config
+      backendRefs:
+        - name: httpbin-external-domain
+          port: 80
+```
+
+</TabItem>
+
+<TabItem value="apisix-crd">
+
+创建启用插件的路由:
+
+```yaml title="limit-count-ic.yaml"
+apiVersion: apisix.apache.org/v2
+kind: ApisixUpstream
+metadata:
+  namespace: aic
+  name: httpbin-external-domain
+spec:
+  ingressClassName: apisix
+  externalNodes:
+  - type: Domain
+    name: httpbin.org
+---
+apiVersion: apisix.apache.org/v2
+kind: ApisixRoute
+metadata:
+  namespace: aic
+  name: limit-count-route
+spec:
+  ingressClassName: apisix
+  http:
+    - name: limit-count-route
+      match:
+        paths:
+          - /get
+      upstreams:
+      - name: httpbin-external-domain
+      plugins:
+      - name: limit-count
+        enable: true
+        config:
+          count: 1
+          time_window: 30
+          rejected_code: 429
+          key_type: var
+          key: remote_addr
+          policy: local
+```
+
+</TabItem>
+
+</Tabs>
+
+将配置应用到集群:
+
+```shell
+kubectl apply -f gatewayproxy.yaml -f limit-count-ic.yaml
+```
+
+</TabItem>
+
+</Tabs>
+
+发送请求进行验证:
+
+```shell
+curl -i "http://127.0.0.1:9080/get";
+```
+
+你应该收到 `HTTP/1.1 200 OK` 响应,并看到以下标头:
+
+```text
+X-Custom-RateLimit-Limit: 1
+X-Custom-RateLimit-Remaining: 0
+X-Custom-RateLimit-Reset: 28
+```


Reply via email to