v1alpha1

package
v2.12.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

+kubebuilder:object:generate=true

Index

Constants

View Source
const (
	MeshRateLimitType model.ResourceType = "MeshRateLimit"
)

Variables

View Source
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

func (in *Conf) DeepCopy() *Conf

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Conf.

func (*Conf) DeepCopyInto

func (in *Conf) DeepCopyInto(out *Conf)

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

func (in *From) DeepCopy() *From

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new From.

func (*From) DeepCopyInto

func (in *From) DeepCopyInto(out *From)

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

type Local struct {
	HTTP *LocalHTTP `json:"http,omitempty"`
	TCP  *LocalTCP  `json:"tcp,omitempty"`
}

LocalConf defines local http or/and tcp rate limit configuration

func (*Local) DeepCopy

func (in *Local) DeepCopy() *Local

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Local.

func (*Local) DeepCopyInto

func (in *Local) DeepCopyInto(out *Local)

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

func (in *LocalHTTP) DeepCopy() *LocalHTTP

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalHTTP.

func (*LocalHTTP) DeepCopyInto

func (in *LocalHTTP) DeepCopyInto(out *LocalHTTP)

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

func (in *LocalTCP) DeepCopy() *LocalTCP

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalTCP.

func (*LocalTCP) DeepCopyInto

func (in *LocalTCP) DeepCopyInto(out *LocalTCP)

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 (*MeshRateLimitResource) GetMeta

func (*MeshRateLimitResource) GetSpec

func (*MeshRateLimitResource) GetStatus

func (*MeshRateLimitResource) SetMeta

func (*MeshRateLimitResource) SetSpec

func (t *MeshRateLimitResource) SetSpec(spec model.ResourceSpec) error

func (*MeshRateLimitResource) SetStatus

func (*MeshRateLimitResource) Validate

func (t *MeshRateLimitResource) Validate() error

type MeshRateLimitResourceList

type MeshRateLimitResourceList struct {
	Items      []*MeshRateLimitResource
	Pagination model.Pagination
}

func (*MeshRateLimitResourceList) AddItem

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 (*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

func (in *Rate) DeepCopy() *Rate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rate.

func (*Rate) DeepCopyInto

func (in *Rate) DeepCopyInto(out *Rate)

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

func (in *Rule) DeepCopy() *Rule

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rule.

func (*Rule) DeepCopyInto

func (in *Rule) DeepCopyInto(out *Rule)

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

func (in *To) DeepCopy() *To

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new To.

func (*To) DeepCopyInto

func (in *To) DeepCopyInto(out *To)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL