このページは、まだ日本語ではご利用いただけません。翻訳中です。
古いプラグインバージョンのドキュメントを閲覧しています。
構成
このプラグインは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
パラメータ
このプラグインの設定で使用できるすべてのパラメータのリストは次のとおりです。
-
name or plugin
string requiredプラグイン名。この場合は
response-ratelimiting。- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
nameです。 - Kubernetes で KongPlugin オブジェクトを使用する場合、フィールドは
pluginです。
- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
-
instance_name
stringプラグインのインスタンスを識別するための任意のカスタム名 (例:
response-ratelimiting_my-service。インスタンス名はKong ManagerとKonnectに表示されるので、 例えば複数のサービスで同じプラグインを複数のコンテキストで実行する場合に便利です。また、Kong Admin API経由で特定のプラグインインスタンスに アクセスするためにも使用できます。
インスタンス名は、次のコンテキスト内で一意である必要があります。
- Kong Gateway Enterpriseのワークスペース内
- Konnectのコントロールプレーン(CP)またはコントロールプレーン(CP)グループ内
- Kong Gateway (OSS)の全世界
-
service.name or service.id
stringプラグインが対象とするサービス名または ID。最上位の
/pluginsエンドポイント. からプラグインをサービスに追加する場合は、これらのパラメータのいずれかを設定してください/services/{serviceName|Id}/pluginsを使用する場合は必要ありません。 -
route.name or route.id
stringプラグインがターゲットとするルート名または ID。最上位の
/pluginsエンドポイント. を通るルートにプラグインを追加する場合は、これらのパラメータのいずれかを設定してください/routes/{routeName|Id}/pluginsを使用する場合は必要ありません。 -
consumer.name or consumer.id
stringプラグインがターゲットとするコンシューマーの名前または ID。 最上位の
/pluginsエンドポイント. からコンシューマーにプラグインを追加する場合は、これらのパラメーターのいずれかを設定してください/consumers/{consumerName|Id}/pluginsを使用する場合は必要ありません。 -
enabled
boolean default:trueこのプラグインが適用されるかどうか。
-
config
record required-
header_name
string default:x-kong-limitThe name of the response header used to increment the counters.
-
limit_by
string default:consumerMust be one of:consumer,credential,ipThe entity that will be used when aggregating the limits:
consumer,credential,ip. If theconsumeror thecredentialcannot be determined, the system will always fallback toip.
-
policy
string default:localMust be one of:local,cluster,redisThe rate-limiting policies to use for retrieving and incrementing the limits.
-
fault_tolerant
boolean required default:trueA 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 see500errors.
-
redis_host
stringWhen using the
redispolicy, this property specifies the address to the Redis server.
-
redis_port
integer default:6379between:065535When using the
redispolicy, this property specifies the port of the Redis server.
-
redis_password
string referenceable len_min:0When using the
redispolicy, this property specifies the password to connect to the Redis server.
-
redis_username
string referenceableWhen using the
redispolicy, this property specifies the username to connect to the Redis server when ACL authentication is desired. This requires Redis v6.0.0+. The username cannot be set todefault.
-
redis_ssl
boolean required default:falseWhen using the
redispolicy, this property specifies if SSL is used to connect to the Redis server.
-
redis_ssl_verify
boolean required default:falseWhen using the
redispolicy withredis_sslset totrue, this property specifies if the server SSL certificate is validated. Note that you need to configure thelua_ssl_trusted_certificateto specify the CA (or server) certificate used by your Redis server. You may also need to configurelua_ssl_verify_depthaccordingly.
-
redis_server_name
stringWhen using the
redispolicy withredis_sslset totrue, this property specifies the server name for the TLS extension Server Name Indication (SNI).
-
redis_timeout
number default:2000When using the
redispolicy, this property specifies the timeout in milliseconds of any command submitted to the Redis server.
-
redis_database
number default:0When using the
redispolicy, this property specifies Redis database to use.
-
block_on_first_violation
boolean required default:falseA 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.
-
hide_client_headers
boolean required default:falseOptionally hide informative response headers.
-
limits
map required len_min:1A map that defines rate limits for the plugin.
-