v1alpha1

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package v1alpha1 defines and implements Nginx Service Mesh APIs

Index

Constants

This section is empty.

Variables

View Source
var (
	// SchemeBuilder collects functions that add things to a scheme. It's to allow
	// code to compile without explicitly referencing generated types. You should
	// declare one in each package that will have generated deep copy or conversion
	// functions.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// AddToScheme applies all the stored functions to the scheme. A non-nil error
	// indicates that one function failed and the attempt was abandoned.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{
	Group:   specs.GroupName,
	Version: "v1alpha1",
}

SchemeGroupVersion is the identifier for the API which includes the name of the group and the version of the API.

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource.

Types

type CircuitBreaker

type CircuitBreaker struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the circuit breaker spec for a destination's traffic
	Spec CircuitBreakerSpec `json:"spec"`
}

CircuitBreaker creates a breaking point at which it will deliver a static response rather than continue sending traffic to a backend.

func (*CircuitBreaker) DeepCopy

func (in *CircuitBreaker) DeepCopy() *CircuitBreaker

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

func (*CircuitBreaker) DeepCopyInto

func (in *CircuitBreaker) DeepCopyInto(out *CircuitBreaker)

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

func (*CircuitBreaker) DeepCopyObject

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

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

type CircuitBreakerList

type CircuitBreakerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []CircuitBreaker `json:"items"`
}

CircuitBreakerList satisfies K8s code gen requirements.

func (*CircuitBreakerList) DeepCopy

func (in *CircuitBreakerList) DeepCopy() *CircuitBreakerList

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

func (*CircuitBreakerList) DeepCopyInto

func (in *CircuitBreakerList) DeepCopyInto(out *CircuitBreakerList)

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

func (*CircuitBreakerList) DeepCopyObject

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

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

type CircuitBreakerSpec

type CircuitBreakerSpec struct {
	// Destination defines which destination to include in the circuit breaker
	Destination v1.ObjectReference `json:"destination"`

	// Defines a fallback service that should be routed to in the event that
	// the circuit breaker trips, rather than returning an error.
	// +optional
	Fallback FallbackSpec `json:"fallback,omitempty"`

	// Errors sets the number of errors before the circuit breaker trips
	Errors int `json:"errors"`

	// TimeoutSeconds sets the timeout the errors must fall within to trip the circuit
	// breaker. Also defines how long the circuit breaker will be tripped before
	// allowing connections to the destination again.
	TimeoutSeconds int `json:"timeoutSeconds"`
}

CircuitBreakerSpec defines the circuit breaker spec that restricts connections to the destination.

func (*CircuitBreakerSpec) DeepCopy

func (in *CircuitBreakerSpec) DeepCopy() *CircuitBreakerSpec

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

func (*CircuitBreakerSpec) DeepCopyInto

func (in *CircuitBreakerSpec) DeepCopyInto(out *CircuitBreakerSpec)

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

type FallbackSpec

type FallbackSpec struct {
	// Service is the name of the Kubernetes Service to send traffic to.
	// Should be of the form <namespace>/<name>. If namespace is not specified,
	// defaults to the 'default' namespace.
	// +optional
	Service string `json:"service,omitempty"`

	// Port is the port on the Service to send traffic to. Defaults to 80.
	// +optional
	Port int `json:"port,omitempty"`
}

FallbackSpec defines the fallback service spec to redirect traffic to when a circuit trips.

func (*FallbackSpec) DeepCopy

func (in *FallbackSpec) DeepCopy() *FallbackSpec

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

func (*FallbackSpec) DeepCopyInto

func (in *FallbackSpec) DeepCopyInto(out *FallbackSpec)

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"`

	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the limit set on traffic between the specified resources
	Spec RateLimitSpec `json:"spec"`
}

RateLimit creates a maximum flow rate between resources. This can include:

Deployments
Services

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"`

	Items []RateLimit `json:"items"`
}

RateLimitList satisfies K8s code gen requirements.

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 RateLimitSpec

type RateLimitSpec struct {
	// Delay sets the amount a request will be delayed (in seconds) when the rate
	// limit is hit. Set to "nodelay" to send back an 503 status immediately
	Delay *intstr.IntOrString `json:"delay,omitempty"`

	// Destination is the resource to which traffic should be rate limited
	Destination v1.ObjectReference `json:"destination"`

	// Name of Rate Limit, i.e. 10rs
	Name string `json:"name"`

	// Maximum allowed rate of traffic
	Rate string `json:"rate"`

	// Sources defines from where traffic should be limited
	// +optional
	Sources []v1.ObjectReference `json:"sources,omitempty"`

	// Burst sets the maximum number of requests a client can make in excess of rate
	// see: https://www.nginx.com/blog/rate-limiting-nginx/#bursts
	// +optional
	Burst int `json:"burst,omitempty"`
}

RateLimitSpec defines the limit spec that restricts the flow of traffic.

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.

Jump to

Keyboard shortcuts

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