v1alpha1

package
v0.0.0-...-bb6076b Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the API. +k8s:deepcopy-gen=package,register +groupName=policy.zirain.info

Index

Constants

View Source
const GroupName = "policy.zirain.info"

GroupName specifies the group name used to register the objects.

Variables

View Source
var (
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	// Depreciated: use Install instead
	AddToScheme = localSchemeBuilder.AddToScheme
	Install     = localSchemeBuilder.AddToScheme
)
View Source
var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha1"}

GroupVersion specifies the group and the version used to register the objects.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects Deprecated: use GroupVersion instead.

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type HeaderMatch

type HeaderMatch struct {
	// Specifies how the header match will be performed to route the request.
	MatchType StringMatchType `json:"matchType"`
	// Specifies the name of the header in the request.
	Key string `json:"key"`
	// If specified, header match will be performed based on the value of the header.
	// This should be empty when type is Exist.
	// +optional
	Value string `json:"value,omitempty"`
	// If false, indicates the exact/prefix/suffix/contains matching should be case insensitive.
	// This has no effect for the regex match.
	// For example, the matcher *data* will match both input string *Data* and *data* if set to false.
	// +optional
	CaseSensitive bool `json:"caseSensitive,omitempty"`
}

func (*HeaderMatch) DeepCopy

func (in *HeaderMatch) DeepCopy() *HeaderMatch

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

func (*HeaderMatch) DeepCopyInto

func (in *HeaderMatch) DeepCopyInto(out *HeaderMatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HttpGlobalRateLimit

type HttpGlobalRateLimit struct {
	Domain string `json:"domain"`
	// Specifies how the request will be matched.
	Match []*RateLimitMatch `json:"match"`
	// Configuration for an external rate limit service.
	Service *RateLimitService `json:"service"`
}

func (*HttpGlobalRateLimit) DeepCopy

func (in *HttpGlobalRateLimit) DeepCopy() *HttpGlobalRateLimit

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

func (*HttpGlobalRateLimit) DeepCopyInto

func (in *HttpGlobalRateLimit) DeepCopyInto(out *HttpGlobalRateLimit)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HttpLocalRateLimit

type HttpLocalRateLimit struct {
	// Rules of how the request will be performed.
	Rules []*RateLimitRule `json:"rules"`
}

func (*HttpLocalRateLimit) DeepCopy

func (in *HttpLocalRateLimit) DeepCopy() *HttpLocalRateLimit

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

func (*HttpLocalRateLimit) DeepCopyInto

func (in *HttpLocalRateLimit) DeepCopyInto(out *HttpLocalRateLimit)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MethodMatch

type MethodMatch struct {
	// Specifies the name of method in a request (e.g. GET, POST, etc.).
	Verb string `json:"verb"`
}

func (*MethodMatch) DeepCopy

func (in *MethodMatch) DeepCopy() *MethodMatch

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

func (*MethodMatch) DeepCopyInto

func (in *MethodMatch) DeepCopyInto(out *MethodMatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RateLimit

type RateLimit struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   RateLimitSpec   `json:"spec,omitempty"`
	Status RateLimitStatus `json:"status,omitempty"`
}

RateLimit is the Schema for the ratelimits API

func (*RateLimit) DeepCopy

func (in *RateLimit) DeepCopy() *RateLimit

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

func (*RateLimit) DeepCopyInto

func (in *RateLimit) DeepCopyInto(out *RateLimit)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RateLimit) DeepCopyObject

func (in *RateLimit) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RateLimitList

type RateLimitList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []RateLimit `json:"items"`
}

RateLimitList contains a list of RateLimit

func (*RateLimitList) DeepCopy

func (in *RateLimitList) DeepCopy() *RateLimitList

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

func (*RateLimitList) DeepCopyInto

func (in *RateLimitList) DeepCopyInto(out *RateLimitList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RateLimitList) DeepCopyObject

func (in *RateLimitList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RateLimitMatch

type RateLimitMatch struct {
	// Rate limit on request path.
	// +optional
	Url *UrlMatch `json:"url,omitempty"`
	// Rate limit on request source.
	// +optional
	Source *SourceMatch `json:"source,omitempty"`
	// Rate limit on request method.
	// +optional
	Method *MethodMatch `json:"method,omitempty"`
	// Rate limit on request header.
	// +optional
	Header *HeaderMatch `json:"header,omitempty"`
}

func (*RateLimitMatch) DeepCopy

func (in *RateLimitMatch) DeepCopy() *RateLimitMatch

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

func (*RateLimitMatch) DeepCopyInto

func (in *RateLimitMatch) DeepCopyInto(out *RateLimitMatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RateLimitRule

type RateLimitRule struct {
	// Specifies how the request will be matched.
	// If match is empty, policy will be used as default policy.
	// +optional
	Match []*RateLimitMatch `json:"match,omitempty"`
	// Policy will be used when the request matched.
	Policy *RatelimitPolicy `json:"policy"`
}

func (*RateLimitRule) DeepCopy

func (in *RateLimitRule) DeepCopy() *RateLimitRule

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

func (*RateLimitRule) DeepCopyInto

func (in *RateLimitRule) DeepCopyInto(out *RateLimitRule)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RateLimitService

type RateLimitService struct {
	// Specifies the service that implements rate limit service.
	// The format is "<Hostname>". The <Hostname> is the full qualified host name in the Istio service
	// registry defined by the Kubernetes service or ServiceEntry. The <Namespace> is the namespace of the Kubernetes
	// service or ServiceEntry object, and can be omitted if the <Hostname> alone can decide the service unambiguously
	// (normally this means there is only 1 such host name in the service registry).
	//
	// Example: "rls.foo.svc.cluster.local" or "rls.example.com".
	Host string `json:"host"`
	// The behaviour in case the rate limiting service does not respond back.
	// When it is set to true, the proxy will not allow traffic in case of
	// communication failure between rate limiting service and the proxy.
	// +optional
	DenyOnFailed bool `json:"denyOnFailed,omitempty"`
	// Specifies the port of the service.
	Port uint32 `json:"port"`
	// The timeout in milliseconds for the rate limit service RPC. If not
	// set, this defaults to 20ms.
	// +optional
	Timeout *metav1.Duration `json:"timeout,omitempty"`
}

func (*RateLimitService) DeepCopy

func (in *RateLimitService) DeepCopy() *RateLimitService

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

func (*RateLimitService) DeepCopyInto

func (in *RateLimitService) DeepCopyInto(out *RateLimitService)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RateLimitSpec

type RateLimitSpec struct {
	// Criteria used to select the specific set of pods/VMs on which this
	// `RateLimit` configuration should be applied. If omitted, the `RateLimit`
	// configuration will be applied to all workload instances in the same namespace.
	WorkloadSelector map[string]string `json:"workloadSelector"`
	// Traffic specifies the configuration of the sidecar for processing
	// inbound/outbound traffic to the attached workload instance.
	// +optional
	Traffic *TrafficSelector `json:"traffic,omitempty"`
	// HTTP Local rate limiting.
	// +optional
	Local *HttpLocalRateLimit `json:"local,omitempty"`
	// HTTP Global rate limiting.
	// +optional
	Global *HttpGlobalRateLimit `json:"global,omitempty"`
}

RateLimitSpec defines the desired state of RateLimit

func (*RateLimitSpec) DeepCopy

func (in *RateLimitSpec) DeepCopy() *RateLimitSpec

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

func (*RateLimitSpec) DeepCopyInto

func (in *RateLimitSpec) DeepCopyInto(out *RateLimitSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RateLimitStatus

type RateLimitStatus struct {
}

RateLimitStatus defines the observed state of RateLimit

func (*RateLimitStatus) DeepCopy

func (in *RateLimitStatus) DeepCopy() *RateLimitStatus

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

func (*RateLimitStatus) DeepCopyInto

func (in *RateLimitStatus) DeepCopyInto(out *RateLimitStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RatelimitPolicy

type RatelimitPolicy struct {
	// Burst is the maximum number of requests allowed to go through in the same arbitrarily small period of time.
	Burst int32 `json:"brust"`
	// The number of tokens added to the bucket during each fill interval.
	TokensPerFill int32 `json:"tokensPerFill"`
	// The fill interval that tokens are added to the bucket. During each fill interval
	// `TokensPerFill` are added to the bucket. The bucket will never contain more than
	// `Burst` tokens.
	Interval metav1.Duration `json:"interval"`
}

func (*RatelimitPolicy) DeepCopy

func (in *RatelimitPolicy) DeepCopy() *RatelimitPolicy

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

func (*RatelimitPolicy) DeepCopyInto

func (in *RatelimitPolicy) DeepCopyInto(out *RatelimitPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SourceMatch

type SourceMatch struct {
	// IP will be performed in Classless Inter-Domain Routing format(e.g. 10.10.0.10/32, 10.10.0.0/16, etc.).
	// When RateLimitType is Local, the mask must be 32.
	Cidr string `json:"cidr"`
}

func (*SourceMatch) DeepCopy

func (in *SourceMatch) DeepCopy() *SourceMatch

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

func (*SourceMatch) DeepCopyInto

func (in *SourceMatch) DeepCopyInto(out *SourceMatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StringMatchType

type StringMatchType string
const (
	// If specified, match will be performed whether the content is in the request.
	StringMatchTypeExist StringMatchType = "Exist"
	// If specified, match will be performed based on the value.
	StringMatchTypeExact StringMatchType = "Exact"
	// If specified, match will be performed based on the prefix of the content.
	StringMatchTypePrefix StringMatchType = "Prefix"
	// If specified, match will be performed based on the suffix of the content.
	StringMatchTypeSuffix StringMatchType = "Suffix"
	// If specified, this regex string is a regular expression in [RE2](https://github.com/google/re2) format.
	StringMatchTypeRegex StringMatchType = "Regex"
)

type TrafficDirection

type TrafficDirection string

TrafficDirection allows selection of the network traffic direction to the attached workload instance.

const (
	// Inbound traffic of sidecar
	TrafficDirectionInbound TrafficDirection = "Inbound"

	// Outbound traffic of sidecar
	TrafficDirectionOutbound TrafficDirection = "Outbound"

	// Traffic of Gateway
	TrafficDirectionGateway TrafficDirection = "Gateway"
)

type TrafficSelector

type TrafficSelector struct {
	// The network traffic direction to the attached workload instance(e.g. Inbound, Outbound, Gateway etc.).
	Direction TrafficDirection `json:"direction"`
	// The name of the outbound service to which should be rate limited,
	// which should be the fully qualified host name in the Istio service
	// registry defined by the Kubernetes service or ServiceEntry
	//
	// NOTE: THIS WILL BE IGNORED IF DIRECTION IS INBOUND
	//
	// +optional
	Host string `json:"host,omitempty"`
	// The inbound service port number, The outbound service port number
	Port uint32 `json:"port"`
}

func (*TrafficSelector) DeepCopy

func (in *TrafficSelector) DeepCopy() *TrafficSelector

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

func (*TrafficSelector) DeepCopyInto

func (in *TrafficSelector) DeepCopyInto(out *TrafficSelector)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type UrlMatch

type UrlMatch struct {
	// Specifies how the path match will be performed(e.g. prefix, suffix, exact, regex, etc.).
	// Exist match type is not support.
	MatchType StringMatchType `json:"matchType"`
	// Path of the request.
	Path string `json:"path"`
	// If false, indicates the exact/prefix/suffix matching should be case insensitive.
	// This has no effect for the regex match.
	// For example, the matcher *data* will match both input string *Data* and *data* if set to false.
	// +optional
	CaseSensitive bool `json:"caseSensitive,omitempty"`
}

func (*UrlMatch) DeepCopy

func (in *UrlMatch) DeepCopy() *UrlMatch

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

func (*UrlMatch) DeepCopyInto

func (in *UrlMatch) DeepCopyInto(out *UrlMatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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