Documentation
¶
Index ¶
- Constants
- Variables
- type AddHeader
- type BackendWeights
- type DirectResponse
- type HTTPListener
- type HTTPPathModifier
- type HTTPRoute
- type Infra
- type InfraMetadata
- type ListenerPort
- type ProtocolType
- type ProxyInfra
- type ProxyListener
- type Redirect
- type RouteDestination
- type StringMatch
- type TLSListenerConfig
- type Xds
Constants ¶
const ( DefaultProxyName = "default" DefaultProxyImage = "envoyproxy/envoy:v1.23-latest" )
Variables ¶
var ( ErrHTTPListenerNameEmpty = errors.New("field Name must be specified") ErrHTTPListenerAddressInvalid = errors.New("field Address must be a valid IP address") ErrHTTPListenerPortInvalid = errors.New("field Port specified is invalid") ErrHTTPListenerHostnamesEmpty = errors.New("field Hostnames must be specified with at least a single hostname 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 ¶
Add header configures a headder to be added to a request. +k8s:deepcopy-gen=true
func (*AddHeader) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddHeader.
func (*AddHeader) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BackendWeights ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRoute.
func (*HTTPRoute) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Infra ¶
type Infra struct {
// Proxy defines managed proxy infrastructure.
Proxy *ProxyInfra
}
Infra defines managed infrastructure. +k8s:deepcopy-gen=true
func (*Infra) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Infra.
func (*Infra) DeepCopyInto ¶
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.
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" )
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Redirect.
func (*Redirect) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
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 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
}
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Xds.
func (*Xds) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (Xds) GetListener ¶
func (x Xds) GetListener(name string) *HTTPListener