このページは、まだ日本語ではご利用いただけません。翻訳中です。
古いプラグインバージョンのドキュメントを閲覧しています。
構成
このプラグインは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
record requiredRedis configuration
-
host
stringA string representing a host name, such as example.com.
-
port
integer default:6379between:065535An integer representing a port number between 0 and 65535, inclusive.
-
timeout
integer default:2000between:02147483646An integer representing a timeout in milliseconds. Must be between 0 and 2^31-2.
-
username
string referenceableUsername 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.
-
password
string referenceable encrypted len_min:0Password to use for Redis connections. If undefined, no AUTH commands are sent to Redis.
-
database
integer default:0Database to use for the Redis connection when using the
redisstrategy
-
ssl
boolean default:falseIf set to true, uses SSL to connect to Redis.
-
ssl_verify
boolean default:falseIf set to true, verifies the validity of the server SSL certificate. If setting this parameter, also configure
lua_ssl_trusted_certificateinkong.confto specify the CA (or server) certificate used by your Redis server. You may also need to configurelua_ssl_verify_depthaccordingly.
-
server_name
stringA string representing an SNI (server name indication) value for TLS.
-
-
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.
-
-
redis_host
stringDeprecation notice:
-
redis_port
integerDeprecation notice:
-
redis_password
string len_min:0Deprecation notice:
-
redis_username
stringDeprecation notice:
-
redis_ssl
booleanDeprecation notice:
-
redis_ssl_verify
booleanDeprecation notice:
-
redis_server_name
stringDeprecation notice:
-
redis_timeout
integerDeprecation notice:
-
redis_database
integerDeprecation notice: