このページは、まだ日本語ではご利用いただけません。翻訳中です。
構成
このプラグインはDB-lessモードと部分的に互換性があります。
The plugin will run fine with the local
policy (which doesn’t use the database) or
the redis
policy (which uses an independent Redis, so it is compatible with DB-less).
The plugin will not work with the cluster
policy, which requires writes to the database.
互換性のあるプロトコル
Response Rate Limitingプラグインは以下のプロトコルに対応しています:
grpc
, grpcs
, http
, https
パラメータ
このプラグインの設定で使用できるすべてのパラメータのリストは次のとおりです。
-
string required
プラグイン名。この場合は
response-ratelimiting
。- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
name
です。 - Kubernetes で KongPlugin オブジェクトを使用する場合、フィールドは
plugin
です。
- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
-
string
プラグインのインスタンスを識別するための任意のカスタム名 (例:
response-ratelimiting_my-service
。インスタンス名はKong ManagerとKonnectに表示されるので、 例えば複数のサービスで同じプラグインを複数のコンテキストで実行する場合に便利です。また、Kong Admin API経由で特定のプラグインインスタンスに アクセスするためにも使用できます。
インスタンス名は、次のコンテキスト内で一意である必要があります。
- Kong Gateway Enterpriseのワークスペース内
- Konnectのコントロールプレーン(CP)またはコントロールプレーン(CP)グループ内
- Kong Gateway (OSS)の全世界
-
string
プラグインが対象とするサービス名または ID。最上位の
/plugins
エンドポイント. からプラグインをサービスに追加する場合は、これらのパラメータのいずれかを設定してください/services/{serviceName|Id}/plugins
を使用する場合は必要ありません。 -
string
プラグインがターゲットとするルート名または ID。最上位の
/plugins
エンドポイント. を通るルートにプラグインを追加する場合は、これらのパラメータのいずれかを設定してください/routes/{routeName|Id}/plugins
を使用する場合は必要ありません。 -
string
プラグインがターゲットとするコンシューマーの名前または ID。 最上位の
/plugins
エンドポイント. からコンシューマーにプラグインを追加する場合は、これらのパラメーターのいずれかを設定してください/consumers/{consumerName|Id}/plugins
を使用する場合は必要ありません。 -
boolean default:
true
このプラグインが適用されるかどうか。
-
record required
-
string default:
x-kong-limit
The name of the response header used to increment the counters.
-
string default:
consumer
Must be one of:consumer
,credential
,ip
The entity that will be used when aggregating the limits:
consumer
,credential
,ip
. If theconsumer
or thecredential
cannot be determined, the system will always fallback toip
.
-
string default:
local
Must be one of:local
,cluster
,redis
The rate-limiting policies to use for retrieving and incrementing the limits.
-
boolean required default:
true
A boolean value that determines if the requests should be proxied even if Kong has troubles connecting a third-party datastore. If
true
, requests will be proxied anyway, effectively disabling the rate-limiting function until the datastore is working again. Iffalse
, then the clients will see500
errors.
-
record required
Redis configuration
-
string
A string representing a host name, such as example.com.
-
integer default:
6379
between:0
65535
An integer representing a port number between 0 and 65535, inclusive.
-
integer default:
2000
between:0
2147483646
An integer representing a timeout in milliseconds. Must be between 0 and 2^31-2.
-
string referenceable
Username to use for Redis connections. If undefined, ACL authentication won’t be performed. This requires Redis v6.0.0+. To be compatible with Redis v5.x.y, you can set it to
default
.
-
string referenceable encrypted len_min:
0
Password to use for Redis connections. If undefined, no AUTH commands are sent to Redis.
-
integer default:
0
Database to use for the Redis connection when using the
redis
strategy
-
boolean default:
false
If set to true, uses SSL to connect to Redis.
-
boolean default:
false
If set to true, verifies the validity of the server SSL certificate. If setting this parameter, also configure
lua_ssl_trusted_certificate
inkong.conf
to specify the CA (or server) certificate used by your Redis server. You may also need to configurelua_ssl_verify_depth
accordingly.
-
string
A string representing an SNI (server name indication) value for TLS.
-
-
boolean required default:
false
A boolean value that determines if the requests should be blocked as soon as one limit is being exceeded. This will block requests that are supposed to consume other limits too.
-
boolean required default:
false
Optionally hide informative response headers.
-
map required len_min:
1
A map that defines rate limits for the plugin.
-
-
string
Deprecation notice: This field is planned to be removed in version 4.0.
-
integer
Deprecation notice: This field is planned to be removed in version 4.0.
-
string len_min:
0
Deprecation notice: This field is planned to be removed in version 4.0.
-
string
Deprecation notice: This field is planned to be removed in version 4.0.
-
boolean
Deprecation notice: This field is planned to be removed in version 4.0.
-
boolean
Deprecation notice: This field is planned to be removed in version 4.0.
-
string
Deprecation notice: This field is planned to be removed in version 4.0.
-
integer
Deprecation notice: This field is planned to be removed in version 4.0.
-
integer
Deprecation notice: This field is planned to be removed in version 4.0.