From e58accf5423570fd331a94d610e977973df7b470 Mon Sep 17 00:00:00 2001 From: Diana <75819066+cloudjumpercat@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:50:10 -0600 Subject: [PATCH 1/8] Start adding plugin template pages Signed-off-by: Diana <75819066+cloudjumpercat@users.noreply.github.com> --- .../kong-inc/service-protection/_changelog.md | 5 +++ .../service-protection/_metadata/_index.yml | 39 ++++++++++++++++++ .../service-protection/how-to/_index.md | 5 +++ .../service-protection/overview/_index.md | 30 ++++++++++++++ .../kong-inc/service-protection/versions.yml | 4 ++ .../icons/hub/kong-inc_service-protection.png | Bin 0 -> 2631 bytes 6 files changed, 83 insertions(+) create mode 100644 app/_hub/kong-inc/service-protection/_changelog.md create mode 100644 app/_hub/kong-inc/service-protection/_metadata/_index.yml create mode 100644 app/_hub/kong-inc/service-protection/how-to/_index.md create mode 100644 app/_hub/kong-inc/service-protection/overview/_index.md create mode 100644 app/_hub/kong-inc/service-protection/versions.yml create mode 100644 app/assets/images/icons/hub/kong-inc_service-protection.png diff --git a/app/_hub/kong-inc/service-protection/_changelog.md b/app/_hub/kong-inc/service-protection/_changelog.md new file mode 100644 index 000000000000..fe552c661784 --- /dev/null +++ b/app/_hub/kong-inc/service-protection/_changelog.md @@ -0,0 +1,5 @@ +## Changelog + +### {{site.base_gateway}} 3.9.x + +* Introduced the Service Protection plugin \ No newline at end of file diff --git a/app/_hub/kong-inc/service-protection/_metadata/_index.yml b/app/_hub/kong-inc/service-protection/_metadata/_index.yml new file mode 100644 index 000000000000..37c68dc6f208 --- /dev/null +++ b/app/_hub/kong-inc/service-protection/_metadata/_index.yml @@ -0,0 +1,39 @@ +# This file sets metadata for an individual Kong plugin. +# View the full instructions for documenting a plugin +# at https://docs.konghq.com/contributing/kong-plugins + +name: Service Protection + +publisher: Kong Inc. + +type: plugin + +categories: + - traffic-control + +desc: Description placeholder. + +free: false + +enterprise: true + +konnect: true + # verify this, just setting to render + +network_config_opts: # + - DB-less mode + - Traditional + +notes: The plugin supports local/redis policies, not cluster policies, so it doesn't work in hybrid mode. + +dbless_compatible: yes + # verify this, just setting to render + # One of the following values allowed: 'yes', 'no' or 'partially'. + +# dbless_explanation: + # (Optional) Free-text explanation containing details about the degree of + # compatibility with DB-less mode. + +# examples_description: | + # (Optional) Any extra description (notes, warnings, etc.) necessary to preface the basic + # examples (for example, https://docs.konghq.com/hub/kong-inc/acl/how-to/basic-example/). \ No newline at end of file diff --git a/app/_hub/kong-inc/service-protection/how-to/_index.md b/app/_hub/kong-inc/service-protection/how-to/_index.md new file mode 100644 index 000000000000..77b629a4a093 --- /dev/null +++ b/app/_hub/kong-inc/service-protection/how-to/_index.md @@ -0,0 +1,5 @@ +--- +nav_title: # Set a title for the navigation menu, for example "Using the example-name plugin" +title: # Set a title to appear at the top of the page +--- + \ No newline at end of file diff --git a/app/_hub/kong-inc/service-protection/overview/_index.md b/app/_hub/kong-inc/service-protection/overview/_index.md new file mode 100644 index 000000000000..e76be1893551 --- /dev/null +++ b/app/_hub/kong-inc/service-protection/overview/_index.md @@ -0,0 +1,30 @@ +--- +nav_title: Overview +title: Overview +--- + + + +## How it works + + + +## More information + + \ No newline at end of file diff --git a/app/_hub/kong-inc/service-protection/versions.yml b/app/_hub/kong-inc/service-protection/versions.yml new file mode 100644 index 000000000000..9cca89617616 --- /dev/null +++ b/app/_hub/kong-inc/service-protection/versions.yml @@ -0,0 +1,4 @@ +strategy: gateway + +releases: + minimum_version: 3.9.x diff --git a/app/assets/images/icons/hub/kong-inc_service-protection.png b/app/assets/images/icons/hub/kong-inc_service-protection.png new file mode 100644 index 0000000000000000000000000000000000000000..7f519ef61d42e85c0dbb32e304abed18abe554db GIT binary patch literal 2631 zcmb_eX*84#8-8ZSSZ7d{iKc90DZ)!(EMtZ&C6X;mn4zKtlfg_V&sbt?NlIC2P%_Du z8QGgq31wc|L}&^jWtV02djEVszJK32-;e9Q&VAqKI_LUxo%?1uJJ}({6~zGnKpwI` z=(5G&zYrDPs_i&Z_ZEqf?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DDT8?<>&i&U-uvK?hMe=PblqK?M|vt+I!yb zr?G9BlD~N^YZgJ3lWa?P{=^6Lnv>NP?C~;Le>}VLGrwuUZ0+-(a4eiWL0mN1`ul)G MHckgCt%&je0PBRWC;$Ke literal 0 HcmV?d00001 From 5d1fa1ace123071112c63def4e5838b8e8e579ca Mon Sep 17 00:00:00 2001 From: Diana <75819066+cloudjumpercat@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:14:02 -0600 Subject: [PATCH 2/8] Fix deployment mode metadata, start adding potential faq Signed-off-by: Diana <75819066+cloudjumpercat@users.noreply.github.com> --- app/_hub/kong-inc/service-protection/_metadata/_index.yml | 4 +--- app/_hub/kong-inc/service-protection/overview/_index.md | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/_hub/kong-inc/service-protection/_metadata/_index.yml b/app/_hub/kong-inc/service-protection/_metadata/_index.yml index 37c68dc6f208..ed1f9072f736 100644 --- a/app/_hub/kong-inc/service-protection/_metadata/_index.yml +++ b/app/_hub/kong-inc/service-protection/_metadata/_index.yml @@ -20,9 +20,7 @@ enterprise: true konnect: true # verify this, just setting to render -network_config_opts: # - - DB-less mode - - Traditional +network_config_opts: traditional, and db-less notes: The plugin supports local/redis policies, not cluster policies, so it doesn't work in hybrid mode. diff --git a/app/_hub/kong-inc/service-protection/overview/_index.md b/app/_hub/kong-inc/service-protection/overview/_index.md index e76be1893551..f1b20ba40c77 100644 --- a/app/_hub/kong-inc/service-protection/overview/_index.md +++ b/app/_hub/kong-inc/service-protection/overview/_index.md @@ -25,6 +25,14 @@ For example: +## FAQ + +does this replace rl and rla + +can i use this with other rl plugins + +when would i use this with other rl plugins + ## More information \ No newline at end of file From 34a5e6f62f249c50f4a9cfb5c3d52d2950204bcb Mon Sep 17 00:00:00 2001 From: Diana <75819066+cloudjumpercat@users.noreply.github.com> Date: Thu, 21 Nov 2024 12:00:29 -0600 Subject: [PATCH 3/8] Add overview content Signed-off-by: Diana <75819066+cloudjumpercat@users.noreply.github.com> --- .../service-protection/overview/_index.md | 58 +++++++++++++------ 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/app/_hub/kong-inc/service-protection/overview/_index.md b/app/_hub/kong-inc/service-protection/overview/_index.md index f1b20ba40c77..dc55ae1397ea 100644 --- a/app/_hub/kong-inc/service-protection/overview/_index.md +++ b/app/_hub/kong-inc/service-protection/overview/_index.md @@ -3,35 +3,57 @@ nav_title: Overview title: Overview --- - + -## How it works +
Can I use the Service Protection plugin with other rate limiting plugins? + +{% capture rl_plugins_compatibility %} +Yes. You can rate limit a service with the Service Protection plugin and rate limit a different service or a consumer with the other rate limiting plugins. +{% endcapture %} + +{{ rl_plugins_compatibility | markdownify }} + +
- +
When would I use the Service Protection plugin with other rate limiting plugins? -## FAQ +{% capture rl_plugins_use_cases %} +You could use the Rate Limiting Advanced plugin to apply global rate limits and then use the Service Protection plugin to apply rate limits to a specific service. Because the Service Protection plugin executes before the Rate Limiting Advanced plugin because of [plugin priority order](), you can apply more granual rate limits to the specific service than you do globally. +{% endcapture %} + +{{ rl_plugins_use_cases | markdownify }} + +
+ +## How it works -does this replace rl and rla +The following diagram shows how the Service Protection plugin rate limits services: -can i use this with other rl plugins +{% mermaid %} +sequenceDiagram + actor Consumer + participant Service Protection plugin + participant Services + Consumer->>Service Protection plugin: Sends a request + Service Protection plugin->>Services: API +{% endmermaid %} -when would i use this with other rl plugins +The Service Protection plugin uses the same [Rate Limiting Library](https://docs.konghq.com/gateway/latest/reference/rate-limiting/) as the other rate limiting plugins. ## More information From e6dc7e6cb4a5ccfc1d46716b6401e0edd51a0076 Mon Sep 17 00:00:00 2001 From: Diana <75819066+cloudjumpercat@users.noreply.github.com> Date: Fri, 22 Nov 2024 08:59:24 -0600 Subject: [PATCH 4/8] Clear up supported deployments and info about how to use multiple RL plugins Signed-off-by: Diana <75819066+cloudjumpercat@users.noreply.github.com> --- .../service-protection/_metadata/_index.yml | 5 ++--- .../kong-inc/service-protection/overview/_index.md | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/_hub/kong-inc/service-protection/_metadata/_index.yml b/app/_hub/kong-inc/service-protection/_metadata/_index.yml index ed1f9072f736..cbb6c6ea2544 100644 --- a/app/_hub/kong-inc/service-protection/_metadata/_index.yml +++ b/app/_hub/kong-inc/service-protection/_metadata/_index.yml @@ -18,11 +18,10 @@ free: false enterprise: true konnect: true - # verify this, just setting to render -network_config_opts: traditional, and db-less +network_config_opts: all -notes: The plugin supports local/redis policies, not cluster policies, so it doesn't work in hybrid mode. +notes: This plugin doesn't support cluster policies. If you want to use this plugin in hybrid mode, you must use Redis for storage. dbless_compatible: yes # verify this, just setting to render diff --git a/app/_hub/kong-inc/service-protection/overview/_index.md b/app/_hub/kong-inc/service-protection/overview/_index.md index dc55ae1397ea..d32b09151f14 100644 --- a/app/_hub/kong-inc/service-protection/overview/_index.md +++ b/app/_hub/kong-inc/service-protection/overview/_index.md @@ -23,7 +23,7 @@ No. The Service Protection plugin only rate limits services. You can still use t
Can I use the Service Protection plugin with other rate limiting plugins? {% capture rl_plugins_compatibility %} -Yes. You can rate limit a service with the Service Protection plugin and rate limit a different service or a consumer with the other rate limiting plugins. +Yes. You can rate limit a service with the Service Protection plugin and rate limit a route or a consumer with the other rate limiting plugins. We don't recommend rate limiting the same services with the Service Protection plugin and another rate limiting plugin. {% endcapture %} {{ rl_plugins_compatibility | markdownify }} @@ -33,13 +33,23 @@ Yes. You can rate limit a service with the Service Protection plugin and rate li
When would I use the Service Protection plugin with other rate limiting plugins? {% capture rl_plugins_use_cases %} -You could use the Rate Limiting Advanced plugin to apply global rate limits and then use the Service Protection plugin to apply rate limits to a specific service. Because the Service Protection plugin executes before the Rate Limiting Advanced plugin because of [plugin priority order](), you can apply more granual rate limits to the specific service than you do globally. +You should use the Service Protection plugin to rate limit your services and use the other rate limiting plugins to limit other entities, like consumers or routes, or to apply global rate limits. {% endcapture %} {{ rl_plugins_use_cases | markdownify }}
+
If I'm currently using a different rate limiting plugin to rate limit my services, should I migrate to the Service Protection plugin? And if so, how do I migrate? + +{% capture rl_plugins_migrate %} +IDK +{% endcapture %} + +{{ rl_plugins_use_migrate | markdownify }} + +
+ ## How it works The following diagram shows how the Service Protection plugin rate limits services: From 8cc2f7c7defbd57562fb50450bc797c69c115999 Mon Sep 17 00:00:00 2001 From: Diana <75819066+cloudjumpercat@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:05:41 -0600 Subject: [PATCH 5/8] Add FAQ info about migrating Signed-off-by: Diana <75819066+cloudjumpercat@users.noreply.github.com> --- app/_hub/kong-inc/service-protection/overview/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/_hub/kong-inc/service-protection/overview/_index.md b/app/_hub/kong-inc/service-protection/overview/_index.md index d32b09151f14..2652545a4222 100644 --- a/app/_hub/kong-inc/service-protection/overview/_index.md +++ b/app/_hub/kong-inc/service-protection/overview/_index.md @@ -43,7 +43,7 @@ You should use the Service Protection plugin to rate limit your services and use
If I'm currently using a different rate limiting plugin to rate limit my services, should I migrate to the Service Protection plugin? And if so, how do I migrate? {% capture rl_plugins_migrate %} -IDK +You can choose to migrate existing services to the Service Protection plugin or only enable the Service Protection plugin on new services. If you choose to migrate, you must do so manually. {% endcapture %} {{ rl_plugins_use_migrate | markdownify }} From a734b530d910fc784cbb793d54f4708fc518097a Mon Sep 17 00:00:00 2001 From: lena-larionova <54370747+lena-larionova@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:59:56 -0800 Subject: [PATCH 6/8] add short description --- .../kong-inc/service-protection/_metadata/_index.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/app/_hub/kong-inc/service-protection/_metadata/_index.yml b/app/_hub/kong-inc/service-protection/_metadata/_index.yml index cbb6c6ea2544..5bd5ca89b87c 100644 --- a/app/_hub/kong-inc/service-protection/_metadata/_index.yml +++ b/app/_hub/kong-inc/service-protection/_metadata/_index.yml @@ -11,7 +11,7 @@ type: plugin categories: - traffic-control -desc: Description placeholder. +desc: Prevent abuse and protect services with absolute limits on the number of requests reaching the service free: false @@ -24,13 +24,3 @@ network_config_opts: all notes: This plugin doesn't support cluster policies. If you want to use this plugin in hybrid mode, you must use Redis for storage. dbless_compatible: yes - # verify this, just setting to render - # One of the following values allowed: 'yes', 'no' or 'partially'. - -# dbless_explanation: - # (Optional) Free-text explanation containing details about the degree of - # compatibility with DB-less mode. - -# examples_description: | - # (Optional) Any extra description (notes, warnings, etc.) necessary to preface the basic - # examples (for example, https://docs.konghq.com/hub/kong-inc/acl/how-to/basic-example/). \ No newline at end of file From c236ea922e60357e3ae9ed69a6eba37b3d8a5246 Mon Sep 17 00:00:00 2001 From: lena-larionova Date: Wed, 4 Dec 2024 14:55:29 -0800 Subject: [PATCH 7/8] how-to guide draft; remove image and add comparison table; various edits --- .../overview/_index.md | 5 + .../rate-limiting-advanced/overview/_index.md | 6 + .../kong-inc/rate-limiting/overview/_index.md | 7 ++ .../kong-inc/service-protection/_changelog.md | 2 +- .../service-protection/_metadata/_index.yml | 4 +- .../service-protection/how-to/_index.md | 112 +++++++++++++++++- .../service-protection/overview/_index.md | 51 +++----- app/_includes/md/plugins-hub/rl-table.md | 6 + 8 files changed, 154 insertions(+), 39 deletions(-) create mode 100644 app/_includes/md/plugins-hub/rl-table.md diff --git a/app/_hub/kong-inc/ai-rate-limiting-advanced/overview/_index.md b/app/_hub/kong-inc/ai-rate-limiting-advanced/overview/_index.md index 8055825eb372..9b78e85a8c1b 100644 --- a/app/_hub/kong-inc/ai-rate-limiting-advanced/overview/_index.md +++ b/app/_hub/kong-inc/ai-rate-limiting-advanced/overview/_index.md @@ -26,6 +26,11 @@ You can also create a generic prompt rate limit using the [request prompt provid - If the rate limit is reached, the next request will be blocked * Known limitation: The disable penalty only works for the `requestPrompt` provider. +## Choosing a rate limiting plugin + +Kong provides multiple rate limiting plugins. Choose one to fit your use case: + +{% include /md/plugins-hub/rl-table.md %} ## Headers sent to the client diff --git a/app/_hub/kong-inc/rate-limiting-advanced/overview/_index.md b/app/_hub/kong-inc/rate-limiting-advanced/overview/_index.md index e27bce7ca6eb..f371c09104cc 100644 --- a/app/_hub/kong-inc/rate-limiting-advanced/overview/_index.md +++ b/app/_hub/kong-inc/rate-limiting-advanced/overview/_index.md @@ -35,6 +35,12 @@ As compared to the standard Rate Limiting plugin, Rate Limiting Advanced provide which could lead to `no memory` errors. {% endif_version %} +## Choosing a rate limiting plugin + +Kong provides multiple rate limiting plugins. Choose one to fit your use case: + +{% include /md/plugins-hub/rl-table.md %} + ## Headers sent to the client When this plugin is enabled, Kong sends some additional headers back to the client diff --git a/app/_hub/kong-inc/rate-limiting/overview/_index.md b/app/_hub/kong-inc/rate-limiting/overview/_index.md index bded972bf46f..26de258e0902 100644 --- a/app/_hub/kong-inc/rate-limiting/overview/_index.md +++ b/app/_hub/kong-inc/rate-limiting/overview/_index.md @@ -15,6 +15,13 @@ provides the ability to apply > **Note:** At least one limit (`second`, `minute`, `hour`, `day`, `month`, `year`) must be configured. Multiple limits can be configured. +## Choosing a rate limiting plugin + +Kong provides multiple rate limiting plugins. Choose one to fit your use case: + +{% include /md/plugins-hub/rl-table.md %} + + ## Headers sent to the client When this plugin is enabled, Kong sends additional headers diff --git a/app/_hub/kong-inc/service-protection/_changelog.md b/app/_hub/kong-inc/service-protection/_changelog.md index fe552c661784..aaf7863bd4d2 100644 --- a/app/_hub/kong-inc/service-protection/_changelog.md +++ b/app/_hub/kong-inc/service-protection/_changelog.md @@ -2,4 +2,4 @@ ### {{site.base_gateway}} 3.9.x -* Introduced the Service Protection plugin \ No newline at end of file +* Introduced the Service Protection plugin. \ No newline at end of file diff --git a/app/_hub/kong-inc/service-protection/_metadata/_index.yml b/app/_hub/kong-inc/service-protection/_metadata/_index.yml index 5bd5ca89b87c..61d31a6987be 100644 --- a/app/_hub/kong-inc/service-protection/_metadata/_index.yml +++ b/app/_hub/kong-inc/service-protection/_metadata/_index.yml @@ -21,6 +21,8 @@ konnect: true network_config_opts: all -notes: This plugin doesn't support cluster policies. If you want to use this plugin in hybrid mode, you must use Redis for storage. +notes: | + This plugin doesn't support cluster policies. + If you want to use this plugin in hybrid mode or in Konnect, use Redis for storage. dbless_compatible: yes diff --git a/app/_hub/kong-inc/service-protection/how-to/_index.md b/app/_hub/kong-inc/service-protection/how-to/_index.md index 77b629a4a093..e0049f58af18 100644 --- a/app/_hub/kong-inc/service-protection/how-to/_index.md +++ b/app/_hub/kong-inc/service-protection/how-to/_index.md @@ -1,5 +1,111 @@ --- -nav_title: # Set a title for the navigation menu, for example "Using the example-name plugin" -title: # Set a title to appear at the top of the page +nav_title: Setting rate limits on multiple entities +title: Setting rate limits on multiple entities --- - \ No newline at end of file + +A common use case for the Service Protection plugin is to use it in conjunction with other rate limiting plugins. +This lets you set granular protections on your services, routes, and so on. + +The follow examples show you how you could use the Service Protection plugin and the Rate Liming Advanced plugin together to apply +different rate limits to different services. + +## Set up the Rate Limiting Advanced plugin + +Enable the Rate Limiting Advanced plugin on a route. + +1. Create a service: + ```sh + curl -i -s -X POST http://localhost:8001/services \ + --data name=rla_example_service \ + --data url='http://httpbin.org' + ``` + +2. Create a route + ```sh + curl -i -X POST http://localhost:8001/services/rla_example_service/routes \ + --data 'paths[]=/rla_mock' \ + --data name=rla_route + ``` + +3. Enable the Rate Limiting Advanced plugin on the route: + ```sh + curl -X POST http://localhost:8001/routes/rla_route/plugins \ + --header "accept: application/json" \ + --header "Content-Type: application/json" \ + --data '{ + "name": "rate-limiting-advanced", + "config": { + "limit": [ + 5 + ], + "window_size": [ + 30 + ], + "identifier": "consumer", + "sync_rate": -1, + "namespace": "rla_example_namespace", + "strategy": "local", + "hide_client_headers": false + } + }' + ``` + + +## Set up the Service Protection plugin + +Create another service and route, and attach the Service Protection plugin to the service. + +1. Create a service: + ```sh + curl -i -s -X POST http://localhost:8001/services \ + --data name=sp_example_service \ + --data url='http://httpbin.org' + ``` + +2. Create a route: + ```sh + curl -i -X POST http://localhost:8001/services/sp_example_service/routes \ + --data 'paths[]=/sp_mock' \ + --data name=sp_route + ``` + +3. Enable the Service Protection plugin: + ```sh + curl -X POST http://localhost:8001/services/sp_example_service/plugins/ \ + --header "accept: application/json" \ + --header "Content-Type: application/json" \ + --data ' + { + "name": "service-protection", + "config": { + "limit": [ + 10 + ], + "window_size": [ + 45 + ], + "sync_rate": -1, + "namespace": "sp_example_namespace", + "strategy": "local", + "hide_client_headers": false + } + }' + ``` + +## Validate + +Verify that the Rate Limiting Advanced plugin and the Service Protection plugin are applying separate limits. + +1. Verify the Rate Limiting Advanced plugin: + ```sh + curl -i http://localhost:8000/rla_mock/anything + + for _ in {1..6}; do curl -s -i localhost:8000/rla_mock/anything; echo; sleep 1; done + ``` + +2. Verify the Service Protection plugin: + ```sh + curl -i http://localhost:8000/sp_mock/anything + + for _ in {1..10}; do curl -s -i localhost:8000/sp_mock/anything; echo; sleep 1; done + ``` \ No newline at end of file diff --git a/app/_hub/kong-inc/service-protection/overview/_index.md b/app/_hub/kong-inc/service-protection/overview/_index.md index 2652545a4222..a6095962de62 100644 --- a/app/_hub/kong-inc/service-protection/overview/_index.md +++ b/app/_hub/kong-inc/service-protection/overview/_index.md @@ -3,17 +3,22 @@ nav_title: Overview title: Overview --- -You can rate limit services using the Service Protection plugin. +Set absolute maximum rate limits for services using the Service Protection plugin. +You can use this plugin together with other rate limiting plugins to apply granular rate limits based on different entities. If you want to apply global rate limits or apply rate limits to routes and consumers, see the following other rate limiting plugins: -* [Rate Limiting plugin](/hub/kong-inc/rate-limiting/): Rate limit services, consumers, and routes or apply global rate limits. -* [Rate Limiting Advanced plugin](/hub/kong-inc/rate-limiting-advanced/): Rate limit services, consumers, and routes or apply global rate limits. The Rate Limiting Advanced plugin extends the functionality of the Rate Limiting plugin by providing advanced tuning settings and the ability to apply multiple limits in sliding or fixed windows. -* [AI Rate Limiting Advanced plugin](/hub/kong-inc/ai-rate-limiting-advanced/): Apply rate limits to traffic from LLMs. + +{% include /md/plugins-hub/rl-table.md %} + +The Service Protection plugin uses the same [Rate Limiting Library](/gateway/latest/reference/rate-limiting/) as the other rate limiting plugins. + +## FAQs
Does the Service Protection plugin replace the Rate Limiting or Rate Limiting Advanced plugins? {% capture rl_plugins_replace %} -No. The Service Protection plugin only rate limits services. You can still use the Rate Limiting and Rate Limiting Advanced plugins to rate limit other entities, like consumers and routes. +No. The Service Protection plugin only rate limits services. You can still use the Rate Limiting and Rate Limiting Advanced +plugins to rate limit other entities, like consumers and routes. {% endcapture %} {{ rl_plugins_replace | markdownify }} @@ -23,7 +28,8 @@ No. The Service Protection plugin only rate limits services. You can still use t
Can I use the Service Protection plugin with other rate limiting plugins? {% capture rl_plugins_compatibility %} -Yes. You can rate limit a service with the Service Protection plugin and rate limit a route or a consumer with the other rate limiting plugins. We don't recommend rate limiting the same services with the Service Protection plugin and another rate limiting plugin. +Yes. You can rate limit a service with the Service Protection plugin and rate limit a route or a consumer with the other rate limiting plugins. +However, we **do not** recommend rate limiting the same service with multiple plugins. {% endcapture %} {{ rl_plugins_compatibility | markdownify }} @@ -33,38 +39,15 @@ Yes. You can rate limit a service with the Service Protection plugin and rate li
When would I use the Service Protection plugin with other rate limiting plugins? {% capture rl_plugins_use_cases %} -You should use the Service Protection plugin to rate limit your services and use the other rate limiting plugins to limit other entities, like consumers or routes, or to apply global rate limits. +You should use the Service Protection plugin to rate limit your services and use the other rate limiting plugins to limit other entities, +like consumers or routes, or to apply global rate limits. {% endcapture %} {{ rl_plugins_use_cases | markdownify }}
-
If I'm currently using a different rate limiting plugin to rate limit my services, should I migrate to the Service Protection plugin? And if so, how do I migrate? - -{% capture rl_plugins_migrate %} -You can choose to migrate existing services to the Service Protection plugin or only enable the Service Protection plugin on new services. If you choose to migrate, you must do so manually. -{% endcapture %} - -{{ rl_plugins_use_migrate | markdownify }} - -
- -## How it works - -The following diagram shows how the Service Protection plugin rate limits services: - -{% mermaid %} -sequenceDiagram - actor Consumer - participant Service Protection plugin - participant Services - Consumer->>Service Protection plugin: Sends a request - Service Protection plugin->>Services: API -{% endmermaid %} - -The Service Protection plugin uses the same [Rate Limiting Library](https://docs.konghq.com/gateway/latest/reference/rate-limiting/) as the other rate limiting plugins. - -## More information +## Get started with the Service Protection plugin - \ No newline at end of file +* [Configuration reference](/hub/kong-inc/service-protection/configuration/) +* [Basic configuration example](/hub/kong-inc/service-protection/how-to/basic-example/) \ No newline at end of file diff --git a/app/_includes/md/plugins-hub/rl-table.md b/app/_includes/md/plugins-hub/rl-table.md new file mode 100644 index 000000000000..7ada4faf4ce7 --- /dev/null +++ b/app/_includes/md/plugins-hub/rl-table.md @@ -0,0 +1,6 @@ +Plugin | Description | Service | Route | Consumer | Consumer Group +-------|-------------|---------|-------|----------|---------------- +[Service Protection](/hub/kong-inc/service-protection/) | Apply absolute rate limits to services. | | | | +[Rate Limiting](/hub/kong-inc/rate-limiting/) | Rate limit services, consumers, and routes or apply global rate limits. | | | | +[Rate Limiting Advanced](/hub/kong-inc/rate-limiting-advanced/) | Rate limit services, consumers, and routes or apply global rate limits. The Rate Limiting Advanced plugin extends the functionality of the Rate Limiting plugin by providing advanced tuning settings and the ability to apply multiple limits in sliding or fixed windows. | | | | +[AI Rate Limiting Advanced](/hub/kong-inc/ai-rate-limiting-advanced/) | Apply rate limits to traffic from LLMs. This plugin extends Rate Limiting Advanced with AI functionality. | | | | \ No newline at end of file From 5491be162df56a8c20d4a98aa700f6a23220a3bd Mon Sep 17 00:00:00 2001 From: lena-larionova Date: Mon, 9 Dec 2024 13:37:21 -0800 Subject: [PATCH 8/8] adjust FAQ --- app/_hub/kong-inc/service-protection/overview/_index.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/_hub/kong-inc/service-protection/overview/_index.md b/app/_hub/kong-inc/service-protection/overview/_index.md index a6095962de62..3903f0692750 100644 --- a/app/_hub/kong-inc/service-protection/overview/_index.md +++ b/app/_hub/kong-inc/service-protection/overview/_index.md @@ -28,8 +28,13 @@ plugins to rate limit other entities, like consumers and routes.
Can I use the Service Protection plugin with other rate limiting plugins? {% capture rl_plugins_compatibility %} -Yes. You can rate limit a service with the Service Protection plugin and rate limit a route or a consumer with the other rate limiting plugins. -However, we **do not** recommend rate limiting the same service with multiple plugins. +Yes. You can rate limit a service with the Service Protection plugin, then rate limit routes, consumers, or consumer groups +with the other rate limiting plugins. + +{:.note} +> **Note:** We don’t recommend using multiple rate limiting plugins on the same **service only**. +We recommend applying Service Protection on the service, and Rate Limiting (or Rate Limiting Advanced) on the service/consumer pair, for more granular rate limits. + {% endcapture %} {{ rl_plugins_compatibility | markdownify }}