このページは、まだ日本語ではご利用いただけません。翻訳中です。
古いプラグインバージョンのドキュメントを閲覧しています。
構成
このプラグインは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.
互換性のあるプロトコル
Rate Limitingプラグインは以下のプロトコルに対応しています:
grpc, grpcs, http, https
パラメータ
このプラグインの設定で使用できるすべてのパラメータのリストは次のとおりです。
-
name or plugin
string requiredプラグイン名。この場合は
rate-limiting。- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
nameです。 - Kubernetes で KongPlugin オブジェクトを使用する場合、フィールドは
pluginです。
- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
-
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-
second
numberThe number of HTTP requests that can be made per second.
-
minute
numberThe number of HTTP requests that can be made per minute.
-
hour
numberThe number of HTTP requests that can be made per hour.
-
day
numberThe number of HTTP requests that can be made per day.
-
month
numberThe number of HTTP requests that can be made per month.
-
year
numberThe number of HTTP requests that can be made per year.
-
limit_by
string default:consumerMust be one of:consumer,credential,ip,service,header,pathThe entity that is used when aggregating the limits. Available values are:
consumercredentialipservice-
header(Theheader_nameconfiguration must be provided.) -
path(Thepathconfiguration must be provided.)
If the entity value for aggregating the limits cannot be determined, the system falls back to
ip.
-
header_name
stringHeader name to be used if
limit_byis set toheader.
-
path
string starts_with:/Path to be used if
limit_byis set topath.
-
policy
string default:clusterlen_min:0Must be one of:local,cluster,redisThe rate-limiting policies to use for retrieving and incrementing the limits. Available values are:
-
local: Counters are stored locally in-memory on the node. -
cluster: Counters are stored in the Kong data store and shared across the nodes. -
redis: Counters are stored on a Redis server and shared across the nodes.
In DB-less, hybrid mode, and Konnect, the
clusterconfig policy is not supported. For DB-less mode or Konnect, use one ofredisorlocal; for hybrid mode, useredis, orlocalfor data planes only.For details on which policy should be used, refer to the implementation considerations.
-
-
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 data store. If
true, requests will be proxied anyway, effectively disabling the rate-limiting function until the data store 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. By default is6379.
-
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 to
default.
-
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 it server SSL certificate is validated. Note that you need to configure the lua_ssl_trusted_certificate to specify the CA (or server) certificate used by your Redis server. You may also need to configure lua_ssl_verify_depth accordingly.
-
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
integer default:0When using the
redispolicy, this property specifies the Redis database to use.
-
hide_client_headers
boolean required default:falseOptionally hide informative response headers.
-