ir

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultProxyName  = "default"
	DefaultProxyImage = "envoyproxy/envoy:v1.23-latest"
)

Variables

View Source
var (
	ErrListenerNameEmpty             = errors.New("field Name must be specified")
	ErrListenerAddressInvalid        = errors.New("field Address must be a valid IP address")
	ErrListenerPortInvalid           = errors.New("field Port specified is invalid")
	ErrHTTPListenerHostnamesEmpty    = errors.New("field Hostnames must be specified with at least a single hostname entry")
	ErrTCPListenesSNIsEmpty          = errors.New("field SNIs must be specified with at least a single server name entry")
	ErrTLSServerCertEmpty            = errors.New("field ServerCertificate must be specified")
	ErrTLSPrivateKey                 = errors.New("field PrivateKey must be specified")
	ErrHTTPRouteNameEmpty            = errors.New("field Name must be specified")
	ErrHTTPRouteMatchEmpty           = errors.New("either PathMatch, HeaderMatches or QueryParamMatches fields must be specified")
	ErrRouteDestinationHostInvalid   = errors.New("field Address must be a valid IP address")
	ErrRouteDestinationPortInvalid   = errors.New("field Port specified is invalid")
	ErrStringMatchConditionInvalid   = errors.New("only one of the Exact, Prefix or SafeRegex fields must be specified")
	ErrDirectResponseStatusInvalid   = errors.New("only HTTP status codes 100 - 599 are supported for DirectResponse")
	ErrRedirectUnsupportedStatus     = errors.New("only HTTP status codes 301 and 302 are supported for redirect filters")
	ErrRedirectUnsupportedScheme     = errors.New("only http and https are supported for the scheme in redirect filters")
	ErrHTTPPathModifierDoubleReplace = errors.New("redirect filter cannot have a path modifier that supplies both fullPathReplace and prefixMatchReplace")
	ErrHTTPPathModifierNoReplace     = errors.New("redirect filter cannot have a path modifier that does not supply either fullPathReplace or prefixMatchReplace")
	ErrAddHeaderEmptyName            = errors.New("header modifier filter cannot configure a header without a name to be added")
	ErrAddHeaderDuplicate            = errors.New("header modifier filter attempts to add the same header more than once (case insensitive)")
	ErrRemoveHeaderDuplicate         = errors.New("header modifier filter attempts to remove the same header more than once (case insensitive)")
)

Functions

This section is empty.

Types

type AddHeader

type AddHeader struct {
	Name   string
	Value  string
	Append bool
}

Add header configures a headder to be added to a request. +k8s:deepcopy-gen=true

func (*AddHeader) DeepCopy

func (in *AddHeader) DeepCopy() *AddHeader

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

func (*AddHeader) DeepCopyInto

func (in *AddHeader) DeepCopyInto(out *AddHeader)

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

func (AddHeader) Validate

func (h AddHeader) Validate() error

Validate the fields within the AddHeader structure

type BackendWeights

type BackendWeights struct {
	Valid   uint32
	Invalid uint32
}

DestinationWeights stores the weights of valid and invalid backends for the route so that 500 error responses can be returned in the same proportions

type DirectResponse

type DirectResponse struct {
	// Body configures the body of the direct response. Currently only a string response
	// is supported, but in the future a config.core.v3.DataSource may replace it.
	Body *string
	// StatusCode will be used for the direct response's status code.
	StatusCode uint32
}

Direct response holds the details for returning a body and status code for a route. +k8s:deepcopy-gen=true

func (*DirectResponse) DeepCopy

func (in *DirectResponse) DeepCopy() *DirectResponse

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

func (*DirectResponse) DeepCopyInto

func (in *DirectResponse) DeepCopyInto(out *DirectResponse)

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

func (DirectResponse) Validate

func (r DirectResponse) Validate() error

Validate the fields within the DirectResponse structure

type HTTPListener

type HTTPListener struct {
	// Name of the HttpListener
	Name string
	// Address that the listener should listen on.
	Address string
	// Port on which the service can be expected to be accessed by clients.
	Port uint32
	// Hostnames (Host/Authority header value) with which the service can be expected to be accessed by clients.
	// This field is required. Wildcard hosts are supported in the suffix or prefix form.
	// Refer to https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#config-route-v3-virtualhost
	// for more info.
	Hostnames []string
	// Tls certificate info. If omitted, the gateway will expose a plain text HTTP server.
	TLS *TLSListenerConfig
	// Routes associated with HTTP traffic to the service.
	Routes []*HTTPRoute
}

HTTPListener holds the listener configuration. +k8s:deepcopy-gen=true

func (*HTTPListener) DeepCopy

func (in *HTTPListener) DeepCopy() *HTTPListener

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

func (*HTTPListener) DeepCopyInto

func (in *HTTPListener) DeepCopyInto(out *HTTPListener)

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

func (HTTPListener) Validate

func (h HTTPListener) Validate() error

Validate the fields within the HTTPListener structure

type HTTPPathModifier

type HTTPPathModifier struct {
	// FullReplace provides a string to replace the full path of the request.
	FullReplace *string
	// PrefixMatchReplace provides a string to replace the matched prefix of the request.
	PrefixMatchReplace *string
}

HTTPPathModifier holds instructions for how to modify the path of a request on a redirect response +k8s:deepcopy-gen=true

func (*HTTPPathModifier) DeepCopy

func (in *HTTPPathModifier) DeepCopy() *HTTPPathModifier

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

func (*HTTPPathModifier) DeepCopyInto

func (in *HTTPPathModifier) DeepCopyInto(out *HTTPPathModifier)

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

func (HTTPPathModifier) Validate

func (r HTTPPathModifier) Validate() error

Validate the fields within the HTTPPathModifier structure

type HTTPRoute

type HTTPRoute struct {
	// Name of the HTTPRoute
	Name string
	// PathMatch defines the match conditions on the path.
	PathMatch *StringMatch
	// HeaderMatches define the match conditions on the request headers for this route.
	HeaderMatches []*StringMatch
	// QueryParamMatches define the match conditions on the query parameters.
	QueryParamMatches []*StringMatch
	// DestinationWeights stores the weights of valid and invalid backends for the route so that 500 error responses can be returned in the same proportions
	BackendWeights BackendWeights
	// AddRequestHeaders defines header/value sets to be added to the headers of requests.
	AddRequestHeaders []AddHeader
	// RemoveRequestHeaders defines a list of headers to be removed from requests.
	RemoveRequestHeaders []string
	// Direct responses to be returned for this route. Takes precedence over Destinations and Redirect.
	DirectResponse *DirectResponse
	// Redirections to be returned for this route. Takes precedence over Destinations.
	Redirect *Redirect
	// Destinations associated with this matched route.
	Destinations []*RouteDestination
}

HTTPRoute holds the route information associated with the HTTP Route +k8s:deepcopy-gen=true

func (*HTTPRoute) DeepCopy

func (in *HTTPRoute) DeepCopy() *HTTPRoute

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

func (*HTTPRoute) DeepCopyInto

func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute)

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

func (HTTPRoute) Validate

func (h HTTPRoute) Validate() error

Validate the fields within the HTTPRoute structure

type Infra

type Infra struct {
	// Proxy defines managed proxy infrastructure.
	Proxy *ProxyInfra
}

Infra defines managed infrastructure. +k8s:deepcopy-gen=true

func NewInfra

func NewInfra() *Infra

NewInfra returns a new Infra with default parameters.

func (*Infra) DeepCopy

func (in *Infra) DeepCopy() *Infra

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

func (*Infra) DeepCopyInto

func (in *Infra) DeepCopyInto(out *Infra)

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

func (*Infra) GetProxyInfra

func (i *Infra) GetProxyInfra() *ProxyInfra

GetProxyInfra returns the ProxyInfra.

func (*Infra) Validate

func (i *Infra) Validate() error

Validate validates the provided Infra.

type InfraMetadata

type InfraMetadata struct {
	// Labels define a map of string keys and values that can be used to organize
	// and categorize proxy infrastructure objects.
	Labels map[string]string
}

InfraMetadata defines metadata for the managed proxy infrastructure. +k8s:deepcopy-gen=true

func NewInfraMetadata

func NewInfraMetadata() *InfraMetadata

NewInfraMetadata returns a new InfraMetadata.

func (*InfraMetadata) DeepCopy

func (in *InfraMetadata) DeepCopy() *InfraMetadata

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

func (*InfraMetadata) DeepCopyInto

func (in *InfraMetadata) DeepCopyInto(out *InfraMetadata)

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

type ListenerPort

type ListenerPort struct {
	// Name is the name of the listener port.
	Name string
	// Protocol is the protocol that the listener port will listener for.
	Protocol ProtocolType
	// ServicePort is the port number the proxy service is listening on.
	ServicePort int32
	// ContainerPort is the port number the proxy container is listening on.
	ContainerPort int32
}

ListenerPort defines a network port of a listener. +k8s:deepcopy-gen=true

func (*ListenerPort) DeepCopy

func (in *ListenerPort) DeepCopy() *ListenerPort

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

func (*ListenerPort) DeepCopyInto

func (in *ListenerPort) DeepCopyInto(out *ListenerPort)

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

type ProtocolType

type ProtocolType string

ProtocolType defines the application protocol accepted by a ListenerPort.

Valid values include "HTTP" and "HTTPS".

const (
	// HTTPProtocolType accepts cleartext HTTP/1.1 sessions over TCP or HTTP/2
	// over cleartext.
	HTTPProtocolType ProtocolType = "HTTP"

	// HTTPSProtocolType accepts HTTP/1.1 or HTTP/2 sessions over TLS.
	HTTPSProtocolType ProtocolType = "HTTPS"

	// Accepts TLS sessions over TCP.
	TLSProtocolType ProtocolType = "TLS"
)

type ProxyInfra

type ProxyInfra struct {
	// Metadata defines metadata for the managed proxy infrastructure.
	Metadata *InfraMetadata
	// Name is the name used for managed proxy infrastructure.
	Name string
	// Config defines user-facing configuration of the managed proxy infrastructure.
	Config *v1alpha1.EnvoyProxy
	// Image is the container image used for the managed proxy infrastructure.
	// If unset, defaults to "envoyproxy/envoy:v1.23-latest".
	Image string
	// Listeners define the listeners exposed by the proxy infrastructure.
	Listeners []ProxyListener
}

ProxyInfra defines managed proxy infrastructure. +k8s:deepcopy-gen=true

func NewProxyInfra

func NewProxyInfra() *ProxyInfra

NewProxyInfra returns a new ProxyInfra with default parameters.

func (*ProxyInfra) DeepCopy

func (in *ProxyInfra) DeepCopy() *ProxyInfra

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

func (*ProxyInfra) DeepCopyInto

func (in *ProxyInfra) DeepCopyInto(out *ProxyInfra)

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

func (*ProxyInfra) GetProxyMetadata

func (p *ProxyInfra) GetProxyMetadata() *InfraMetadata

GetProxyMetadata returns the InfraMetadata.

func (*ProxyInfra) ObjectName

func (p *ProxyInfra) ObjectName() string

ObjectName returns the name of the proxy infrastructure object.

func (*ProxyInfra) Validate

func (p *ProxyInfra) Validate() error

Validate validates the provided ProxyInfra.

type ProxyListener

type ProxyListener struct {
	// Address is the address that the listener should listen on.
	Address string
	// Ports define network ports of the listener.
	Ports []ListenerPort
}

ProxyListener defines the listener configuration of the proxy infrastructure. +k8s:deepcopy-gen=true

func NewProxyListeners

func NewProxyListeners() []ProxyListener

NewProxyListeners returns a new slice of ProxyListener with default parameters.

func (*ProxyListener) DeepCopy

func (in *ProxyListener) DeepCopy() *ProxyListener

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

func (*ProxyListener) DeepCopyInto

func (in *ProxyListener) DeepCopyInto(out *ProxyListener)

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

type Redirect

type Redirect struct {
	// Scheme configures the replacement of the request's scheme.
	Scheme *string
	// Hostname configures the replacement of the request's hostname.
	Hostname *string
	// Path contains config for rewriting the path of the request.
	Path *HTTPPathModifier
	// Port configures the replacement of the request's port.
	Port *uint32
	// Status code configures the redirection response's status code.
	StatusCode *int32
}

Redirect holds the details for how and where to redirect a request +k8s:deepcopy-gen=true

func (*Redirect) DeepCopy

func (in *Redirect) DeepCopy() *Redirect

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

func (*Redirect) DeepCopyInto

func (in *Redirect) DeepCopyInto(out *Redirect)

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

func (Redirect) Validate

func (r Redirect) Validate() error

Validate the fields within the Redirect structure

type RouteDestination

type RouteDestination struct {
	// Host refers to the FQDN or IP address of the backend service.
	Host string
	// Port on the service to forward the request to.
	Port uint32
	// Weight associated with this destination.
	Weight uint32
}

RouteDestination holds the destination details associated with the route

func (RouteDestination) Validate

func (r RouteDestination) Validate() error

Validate the fields within the RouteDestination structure

type StringMatch

type StringMatch struct {
	// Name of the field to match on.
	Name string
	// Exact match condition.
	Exact *string
	// Prefix match condition.
	Prefix *string
	// SafeRegex match condition.
	SafeRegex *string
}

StringMatch holds the various match conditions. Only one of Exact, Prefix or SafeRegex can be set. +k8s:deepcopy-gen=true

func (*StringMatch) DeepCopy

func (in *StringMatch) DeepCopy() *StringMatch

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

func (*StringMatch) DeepCopyInto

func (in *StringMatch) DeepCopyInto(out *StringMatch)

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

func (StringMatch) Validate

func (s StringMatch) Validate() error

Validate the fields within the StringMatch structure

type TCPListener

type TCPListener struct {
	// Name of the TCPListener
	Name string
	// Address that the listener should listen on.
	Address string
	// Port on which the service can be expected to be accessed by clients.
	Port uint32
	// TLS information required for TLS Passthrough, If provided, incoming
	// connections' server names are inspected and routed to backends accordingly.
	TLS *TLSInspectorConfig
	// Destinations associated with TCP traffic to the service.
	Destinations []*RouteDestination
}

TCPListener holds the TCP listener configuration. +k8s:deepcopy-gen=true

func (*TCPListener) DeepCopy

func (in *TCPListener) DeepCopy() *TCPListener

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

func (*TCPListener) DeepCopyInto

func (in *TCPListener) DeepCopyInto(out *TCPListener)

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

func (TCPListener) Validate

func (h TCPListener) Validate() error

Validate the fields within the TCPListener structure

type TLSInspectorConfig

type TLSInspectorConfig struct {
	// Server names that are compared against the server names of a new connection.
	// Wildcard hosts are supported in the prefix form. Partial wildcards are not
	// supported, and values like *w.example.com are invalid.
	// SNIs are used only in case of TLS Passthrough.
	SNIs []string
}

TLSInspectorConfig holds the configuration required for inspecting TLS passthrough connections. +k8s:deepcopy-gen=true

func (*TLSInspectorConfig) DeepCopy

func (in *TLSInspectorConfig) DeepCopy() *TLSInspectorConfig

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

func (*TLSInspectorConfig) DeepCopyInto

func (in *TLSInspectorConfig) DeepCopyInto(out *TLSInspectorConfig)

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

func (TLSInspectorConfig) Validate

func (t TLSInspectorConfig) Validate() error

type TLSListenerConfig

type TLSListenerConfig struct {
	// ServerCertificate of the server.
	ServerCertificate []byte
	// PrivateKey for the server.
	PrivateKey []byte
}

TLSListenerConfig holds the configuration for downstream TLS context. +k8s:deepcopy-gen=true

func (*TLSListenerConfig) DeepCopy

func (in *TLSListenerConfig) DeepCopy() *TLSListenerConfig

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

func (*TLSListenerConfig) DeepCopyInto

func (in *TLSListenerConfig) DeepCopyInto(out *TLSListenerConfig)

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

func (TLSListenerConfig) Validate

func (t TLSListenerConfig) Validate() error

Validate the fields within the TLSListenerConfig structure

type Xds

type Xds struct {
	// HTTP listeners exposed by the gateway.
	HTTP []*HTTPListener
	// TCP Listeners exposed by the gateway.
	TCP []*TCPListener
}

Xds holds the intermediate representation of a Gateway and is used by the xDS Translator to convert it into xDS resources. +k8s:deepcopy-gen=true

func (*Xds) DeepCopy

func (in *Xds) DeepCopy() *Xds

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

func (*Xds) DeepCopyInto

func (in *Xds) DeepCopyInto(out *Xds)

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

func (Xds) GetHTTPListener

func (x Xds) GetHTTPListener(name string) *HTTPListener

func (Xds) GetTCPListener

func (x Xds) GetTCPListener(name string) *TCPListener

func (Xds) Printable

func (x Xds) Printable() *Xds

Printable returns a deep copy of the resource that can be safely logged.

func (Xds) Validate

func (x Xds) Validate() error

Validate the fields within the Xds structure.

Jump to

Keyboard shortcuts

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