Documentation
¶
Overview ¶
+kubebuilder:object:generate=true
Index ¶
- Constants
- Variables
- type Conf
- type From
- type HeaderKeyValue
- type HeaderModifier
- type Local
- type LocalHTTP
- type LocalTCP
- type MeshRateLimit
- func (in *MeshRateLimit) DeepCopy() *MeshRateLimit
- func (in *MeshRateLimit) DeepCopyInto(out *MeshRateLimit)
- func (x *MeshRateLimit) GetFromList() []core_model.PolicyItem
- func (x *MeshRateLimit) GetRules() []inbound.RuleEntry
- func (x *MeshRateLimit) GetTargetRef() common_api.TargetRef
- func (x *MeshRateLimit) GetToList() []core_model.PolicyItem
- type MeshRateLimitResource
- func (t *MeshRateLimitResource) Deprecations() []string
- func (t *MeshRateLimitResource) Descriptor() model.ResourceTypeDescriptor
- func (t *MeshRateLimitResource) GetMeta() model.ResourceMeta
- func (t *MeshRateLimitResource) GetSpec() model.ResourceSpec
- func (t *MeshRateLimitResource) GetStatus() model.ResourceStatus
- func (t *MeshRateLimitResource) SetMeta(m model.ResourceMeta)
- func (t *MeshRateLimitResource) SetSpec(spec model.ResourceSpec) error
- func (t *MeshRateLimitResource) SetStatus(model.ResourceStatus) error
- func (t *MeshRateLimitResource) Validate() error
- type MeshRateLimitResourceList
- func (l *MeshRateLimitResourceList) AddItem(r model.Resource) error
- func (l *MeshRateLimitResourceList) GetItemType() model.ResourceType
- func (l *MeshRateLimitResourceList) GetItems() []model.Resource
- func (l *MeshRateLimitResourceList) GetPagination() *model.Pagination
- func (l *MeshRateLimitResourceList) NewItem() model.Resource
- func (l *MeshRateLimitResourceList) SetPagination(p model.Pagination)
- type OnRateLimit
- type Rate
- type Rule
- type To
Constants ¶
const (
MeshRateLimitType model.ResourceType = "MeshRateLimit"
)
Variables ¶
var MeshRateLimitResourceTypeDescriptor = model.ResourceTypeDescriptor{ Name: MeshRateLimitType, Resource: NewMeshRateLimitResource(), ResourceList: &MeshRateLimitResourceList{}, Scope: model.ScopeMesh, KDSFlags: model.GlobalToZonesFlag | model.ZoneToGlobalFlag | model.SyncedAcrossZonesFlag, WsPath: "meshratelimits", KumactlArg: "meshratelimit", KumactlListArg: "meshratelimits", AllowToInspect: true, IsPolicy: true, IsDestination: false, IsExperimental: false, SingularDisplayName: "Mesh Rate Limit", PluralDisplayName: "Mesh Rate Limits", IsPluginOriginated: true, IsTargetRefBased: true, HasToTargetRef: true, HasFromTargetRef: true, HasRulesTargetRef: true, HasStatus: false, AllowedOnSystemNamespaceOnly: false, IsReferenceableInTo: false, ShortName: "mrl", IsFromAsRules: true, }
Functions ¶
This section is empty.
Types ¶
type Conf ¶
type Conf struct {
Local *Local `json:"local,omitempty"`
}
func (*Conf) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Conf.
func (*Conf) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type From ¶
type From struct {
// TargetRef is a reference to the resource that represents a group of
// clients.
TargetRef common_api.TargetRef `json:"targetRef"`
// Default is a configuration specific to the group of clients referenced in
// 'targetRef'
Default Conf `json:"default,omitempty"`
}
func (*From) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new From.
func (*From) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*From) GetDefault ¶
func (x *From) GetDefault() interface{}
func (*From) GetTargetRef ¶
func (x *From) GetTargetRef() common_api.TargetRef
type HeaderKeyValue ¶
type HeaderKeyValue struct {
Name common_api.HeaderName `json:"name"`
Value common_api.HeaderValue `json:"value"`
}
func (*HeaderKeyValue) DeepCopy ¶
func (in *HeaderKeyValue) DeepCopy() *HeaderKeyValue
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HeaderKeyValue.
func (*HeaderKeyValue) DeepCopyInto ¶
func (in *HeaderKeyValue) DeepCopyInto(out *HeaderKeyValue)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type HeaderModifier ¶
type HeaderModifier struct {
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=16
Set *[]HeaderKeyValue `json:"set,omitempty"`
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=16
Add *[]HeaderKeyValue `json:"add,omitempty"`
}
Configuration to set or add multiple values for a header must use RFC 7230 header value formatting, separating each value with a comma.
func (*HeaderModifier) DeepCopy ¶
func (in *HeaderModifier) DeepCopy() *HeaderModifier
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HeaderModifier.
func (*HeaderModifier) DeepCopyInto ¶
func (in *HeaderModifier) DeepCopyInto(out *HeaderModifier)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Local ¶
LocalConf defines local http or/and tcp rate limit configuration
func (*Local) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Local.
func (*Local) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LocalHTTP ¶
type LocalHTTP struct {
// Define if rate limiting should be disabled.
Disabled *bool `json:"disabled,omitempty"`
// Defines how many requests are allowed per interval.
// +kuma:non-mergeable-struct
RequestRate *Rate `json:"requestRate,omitempty"`
// Describes the actions to take on a rate limit event
OnRateLimit *OnRateLimit `json:"onRateLimit,omitempty"`
}
LocalHTTP defines configuration of local HTTP rate limiting https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/local_rate_limit_filter
func (*LocalHTTP) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalHTTP.
func (*LocalHTTP) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LocalTCP ¶
type LocalTCP struct {
// Define if rate limiting should be disabled.
// Default: false
Disabled *bool `json:"disabled,omitempty"`
// Defines how many connections are allowed per interval.
// +kuma:non-mergeable-struct
ConnectionRate *Rate `json:"connectionRate,omitempty"`
}
LocalTCP defines confguration of local TCP rate limiting https://www.envoyproxy.io/docs/envoy/latest/configuration/listeners/network_filters/local_rate_limit_filter
func (*LocalTCP) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalTCP.
func (*LocalTCP) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MeshRateLimit ¶
type MeshRateLimit struct {
// TargetRef is a reference to the resource the policy takes an effect on.
// The resource could be either a real store object or virtual resource
// defined inplace.
TargetRef *common_api.TargetRef `json:"targetRef,omitempty"`
// From list makes a match between clients and corresponding configurations
From *[]From `json:"from,omitempty"`
// To list makes a match between clients and corresponding configurations
To *[]To `json:"to,omitempty"`
// Rules defines inbound rate limiting configurations. Currently limited to
// selecting all inbound traffic, as L7 matching is not yet implemented.
Rules *[]Rule `json:"rules,omitempty"`
}
MeshRateLimit +kuma:policy:is_from_as_rules=true
func (*MeshRateLimit) DeepCopy ¶
func (in *MeshRateLimit) DeepCopy() *MeshRateLimit
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshRateLimit.
func (*MeshRateLimit) DeepCopyInto ¶
func (in *MeshRateLimit) DeepCopyInto(out *MeshRateLimit)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*MeshRateLimit) GetFromList ¶
func (x *MeshRateLimit) GetFromList() []core_model.PolicyItem
func (*MeshRateLimit) GetRules ¶
func (x *MeshRateLimit) GetRules() []inbound.RuleEntry
func (*MeshRateLimit) GetTargetRef ¶
func (x *MeshRateLimit) GetTargetRef() common_api.TargetRef
func (*MeshRateLimit) GetToList ¶
func (x *MeshRateLimit) GetToList() []core_model.PolicyItem
type MeshRateLimitResource ¶
type MeshRateLimitResource struct {
Meta model.ResourceMeta
Spec *MeshRateLimit
}
func NewMeshRateLimitResource ¶
func NewMeshRateLimitResource() *MeshRateLimitResource
func (*MeshRateLimitResource) Deprecations ¶
func (t *MeshRateLimitResource) Deprecations() []string
func (*MeshRateLimitResource) Descriptor ¶
func (t *MeshRateLimitResource) Descriptor() model.ResourceTypeDescriptor
func (*MeshRateLimitResource) GetMeta ¶
func (t *MeshRateLimitResource) GetMeta() model.ResourceMeta
func (*MeshRateLimitResource) GetSpec ¶
func (t *MeshRateLimitResource) GetSpec() model.ResourceSpec
func (*MeshRateLimitResource) GetStatus ¶
func (t *MeshRateLimitResource) GetStatus() model.ResourceStatus
func (*MeshRateLimitResource) SetMeta ¶
func (t *MeshRateLimitResource) SetMeta(m model.ResourceMeta)
func (*MeshRateLimitResource) SetSpec ¶
func (t *MeshRateLimitResource) SetSpec(spec model.ResourceSpec) error
func (*MeshRateLimitResource) SetStatus ¶
func (t *MeshRateLimitResource) SetStatus(model.ResourceStatus) error
func (*MeshRateLimitResource) Validate ¶
func (t *MeshRateLimitResource) Validate() error
type MeshRateLimitResourceList ¶
type MeshRateLimitResourceList struct {
Items []*MeshRateLimitResource
Pagination model.Pagination
}
func (*MeshRateLimitResourceList) AddItem ¶
func (l *MeshRateLimitResourceList) AddItem(r model.Resource) error
func (*MeshRateLimitResourceList) GetItemType ¶
func (l *MeshRateLimitResourceList) GetItemType() model.ResourceType
func (*MeshRateLimitResourceList) GetItems ¶
func (l *MeshRateLimitResourceList) GetItems() []model.Resource
func (*MeshRateLimitResourceList) GetPagination ¶
func (l *MeshRateLimitResourceList) GetPagination() *model.Pagination
func (*MeshRateLimitResourceList) NewItem ¶
func (l *MeshRateLimitResourceList) NewItem() model.Resource
func (*MeshRateLimitResourceList) SetPagination ¶
func (l *MeshRateLimitResourceList) SetPagination(p model.Pagination)
type OnRateLimit ¶
type OnRateLimit struct {
// The HTTP status code to be set on a rate limit event
Status *uint32 `json:"status,omitempty"`
// The Headers to be added to the HTTP response on a rate limit event
Headers *HeaderModifier `json:"headers,omitempty"`
}
func (*OnRateLimit) DeepCopy ¶
func (in *OnRateLimit) DeepCopy() *OnRateLimit
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OnRateLimit.
func (*OnRateLimit) DeepCopyInto ¶
func (in *OnRateLimit) DeepCopyInto(out *OnRateLimit)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Rate ¶
type Rate struct {
// Number of units per interval (depending on usage it can be a number of requests,
// or a number of connections).
Num uint32 `json:"num"`
// The interval the number of units is accounted for.
Interval k8s.Duration `json:"interval"`
}
func (*Rate) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rate.
func (*Rate) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Rule ¶
type Rule struct {
// Default contains configuration of the inbound rate limits
Default Conf `json:"default,omitempty"`
}
func (*Rule) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rule.
func (*Rule) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Rule) GetDefault ¶
func (x *Rule) GetDefault() interface{}
type To ¶
type To struct {
// TargetRef is a reference to the resource that represents a group of
// clients.
TargetRef common_api.TargetRef `json:"targetRef"`
// Default is a configuration specific to the group of clients referenced in
// 'targetRef'
Default Conf `json:"default,omitempty"`
}
func (*To) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new To.
func (*To) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*To) GetDefault ¶
func (x *To) GetDefault() interface{}
func (*To) GetTargetRef ¶
func (x *To) GetTargetRef() common_api.TargetRef