RateLimitPolicy
Package v1alpha3 contains the API Schema definitions for WSO2 APK.
Resource Types:
APIRateLimitPolicy ¶
(Appears on: RateLimitAPIPolicy)
APIRateLimitPolicy defines the desired state of APIPolicy
Field | Description |
---|---|
requestsPerUnit
uint32
|
RequestPerUnit is the number of requests allowed per unit time |
unit
string
|
Unit is the unit of the requestsPerUnit |
BurstControl ¶
(Appears on: SubscriptionRateLimitPolicy)
BurstControl defines the rule for token count quota.
Field | Description |
---|---|
requestsPerUnit
uint32
|
|
unit
string
|
CustomRateLimitPolicy ¶
(Appears on: RateLimitAPIPolicy)
CustomRateLimitPolicy defines the desired state of CustomPolicy
Field | Description |
---|---|
requestsPerUnit
uint32
|
RequestPerUnit is the number of requests allowed per unit time |
unit
string
|
Unit is the unit of the requestsPerUnit |
key
string
|
Key is the key of the custom policy |
value
string
|
(Optional)
Value is the value of the custom policy |
organization
string
|
Organization is the organization of the policy |
RateLimitAPIPolicy ¶
(Appears on: RateLimitPolicySpec)
RateLimitAPIPolicy defines the desired state of Policy
Field | Description |
---|---|
api
APIRateLimitPolicy
|
(Optional)
API level ratelimit policy |
subscription
SubscriptionRateLimitPolicy
|
(Optional)
Subscription level ratelimit policy |
custom
CustomRateLimitPolicy
|
(Optional)
Custom ratelimit policy |
RateLimitPolicy ¶
RateLimitPolicy is the Schema for the ratelimitpolicies API
Field | Description | ||||||
---|---|---|---|---|---|---|---|
metadata
Kubernetes meta/v1.ObjectMeta
|
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||
spec
RateLimitPolicySpec
|
|
||||||
status
RateLimitPolicyStatus
|
RateLimitPolicySpec ¶
(Appears on: RateLimitPolicy)
RateLimitPolicySpec defines the desired state of RateLimitPolicy
Field | Description |
---|---|
default
RateLimitAPIPolicy
|
|
override
RateLimitAPIPolicy
|
|
targetRef
sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyTargetReference
|
RateLimitPolicyStatus ¶
(Appears on: RateLimitPolicy)
RateLimitPolicyStatus defines the observed state of RateLimitPolicy
RequestCount ¶
(Appears on: SubscriptionRateLimitPolicy)
RequestCount defines the rule for request count quota.
Field | Description |
---|---|
requestsPerUnit
uint32
|
|
unit
string
|
SubscriptionRateLimitPolicy ¶
(Appears on: RateLimitAPIPolicy)
SubscriptionRateLimitPolicy defines the subscription-level rate limiting policy.
Field | Description |
---|---|
stopOnQuotaReach
bool
|
|
organization
string
|
|
requestCount
RequestCount
|
|
burstControl
BurstControl
|
Generated with gen-crd-api-reference-docs
.
Rate Limiter Samples¶
RateLimitPolicy for API¶
The following defines a Rate Limiting policy at the API-level.
apiVersion: dp.wso2.com/v1alpha1
kind: RateLimitPolicy
metadata:
name: sand-http-bin-ratelimit
spec:
default:
api:
requestsPerUnit: 5
unit: Minute
targetRef:
kind: API
name: http-bin-api
group: gateway.networking.k8s.io
Rate Limit for Resource¶
The following defines a Rate Limiting policy at the Resource (HTTPRoute) level.
apiVersion: dp.wso2.com/v1alpha1
kind: RateLimitPolicy
metadata:
name: sand-http-bin-ratelimit
spec:
override:
api:
requestsPerUnit: 5
unit: Minute
targetRef:
kind: Resource
name: sand-http-route-http-bin-api
group: gateway.networking.k8s.io
Custom Rate Limit Policy¶
The following defines a custom Rate Limiting policy.
apiVersion: dp.wso2.com/v1alpha1
kind: RateLimitPolicy
metadata:
name: http-bin-ratelimit-usergroup
spec:
override:
custom:
key: org_key
value: admin
requestsPerUnit: 20
unit: Minute
organization: default
targetRef:
kind: Gateway
name: default
group: gateway.networking.k8s.io
Refer the Rate Limit documentation for more information on how to configure rate limit policies.