v3

package
v1.24.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ENVOY_HTTP_LISTENER            = "ingress_http"
	ENVOY_FALLBACK_ROUTECONFIG     = "ingress_fallbackcert"
	ENVOY_HTTPS_LISTENER           = "ingress_https"
	DEFAULT_HTTP_ACCESS_LOG        = "/dev/stdout"
	DEFAULT_HTTP_LISTENER_ADDRESS  = "0.0.0.0"
	DEFAULT_HTTP_LISTENER_PORT     = 8080
	DEFAULT_HTTPS_ACCESS_LOG       = "/dev/stdout"
	DEFAULT_HTTPS_LISTENER_ADDRESS = DEFAULT_HTTP_LISTENER_ADDRESS
	DEFAULT_HTTPS_LISTENER_PORT    = 8443
)

nolint:revive

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterCache

type ClusterCache struct {
	contour.Cond
	// contains filtered or unexported fields
}

ClusterCache manages the contents of the gRPC CDS cache.

func (*ClusterCache) Contents

func (c *ClusterCache) Contents() []proto.Message

Contents returns a copy of the cache's contents.

func (*ClusterCache) OnChange

func (c *ClusterCache) OnChange(root *dag.DAG)

func (*ClusterCache) Query

func (c *ClusterCache) Query(names []string) []proto.Message

func (*ClusterCache) TypeURL

func (*ClusterCache) TypeURL() string

func (*ClusterCache) Update

func (c *ClusterCache) Update(v map[string]*envoy_cluster_v3.Cluster)

Update replaces the contents of the cache with the supplied map.

type EndpointsCache

type EndpointsCache struct {
	// contains filtered or unexported fields
}

EndpointsCache is a cache of Endpoint and ServiceCluster objects.

func (*EndpointsCache) DeleteEndpoint

func (c *EndpointsCache) DeleteEndpoint(ep *v1.Endpoints) bool

DeleteEndpoint deletes ep from the cache. Any ServiceClusters that are backed by a Service that ep belongs become stale. Returns a boolean indicating whether any ServiceClusters use ep or not.

func (*EndpointsCache) Recalculate

Recalculate regenerates all the ClusterLoadAssignments from the cached Endpoints and stale ServiceClusters. A ClusterLoadAssignment will be generated for every stale ServerCluster, however, if there are no endpoints for the Services in the ServiceCluster, the ClusterLoadAssignment will be empty.

func (*EndpointsCache) SetClusters

func (c *EndpointsCache) SetClusters(clusters []*dag.ServiceCluster) error

SetClusters replaces the cache of ServiceCluster resources. All the added clusters will be marked stale.

func (*EndpointsCache) UpdateEndpoint

func (c *EndpointsCache) UpdateEndpoint(ep *v1.Endpoints) bool

UpdateEndpoint adds ep to the cache, or replaces it if it is already cached. Any ServiceClusters that are backed by a Service that ep belongs become stale. Returns a boolean indicating whether any ServiceClusters use ep or not.

type EndpointsTranslator

type EndpointsTranslator struct {
	// Observer notifies when the endpoints cache has been updated.
	Observer contour.Observer

	contour.Cond
	logrus.FieldLogger
	// contains filtered or unexported fields
}

A EndpointsTranslator translates Kubernetes Endpoints objects into Envoy ClusterLoadAssignment resources.

func NewEndpointsTranslator

func NewEndpointsTranslator(log logrus.FieldLogger) *EndpointsTranslator

NewEndpointsTranslator allocates a new endpoints translator.

func (*EndpointsTranslator) Contents

func (e *EndpointsTranslator) Contents() []proto.Message

Contents returns a copy of the contents of the cache.

func (*EndpointsTranslator) Merge

Merge combines the given entries with the existing entries in the EndpointsTranslator. If the same key exists in both maps, an existing entry is replaced.

func (*EndpointsTranslator) OnAdd

func (e *EndpointsTranslator) OnAdd(obj interface{})

func (*EndpointsTranslator) OnChange

func (e *EndpointsTranslator) OnChange(root *dag.DAG)

OnChange observes DAG rebuild events.

func (*EndpointsTranslator) OnDelete

func (e *EndpointsTranslator) OnDelete(obj interface{})

func (*EndpointsTranslator) OnUpdate

func (e *EndpointsTranslator) OnUpdate(oldObj, newObj interface{})

func (*EndpointsTranslator) Query

func (e *EndpointsTranslator) Query(names []string) []proto.Message

func (*EndpointsTranslator) TypeURL

func (*EndpointsTranslator) TypeURL() string

type Listener added in v1.14.0

type Listener struct {
	Name    string
	Address string
	Port    int
}

type ListenerCache

type ListenerCache struct {
	Config ListenerConfig
	contour.Cond
	// contains filtered or unexported fields
}

ListenerCache manages the contents of the gRPC LDS cache.

func NewListenerCache

func NewListenerCache(
	listenerConfig ListenerConfig,
	metricsConfig contour_api_v1alpha1.MetricsConfig,
	healthConfig contour_api_v1alpha1.HealthConfig,
	adminPort int,
) *ListenerCache

NewListenerCache returns an instance of a ListenerCache

func (*ListenerCache) Contents

func (c *ListenerCache) Contents() []proto.Message

Contents returns a copy of the cache's contents.

func (*ListenerCache) OnChange

func (c *ListenerCache) OnChange(root *dag.DAG)

func (*ListenerCache) Query

func (c *ListenerCache) Query(names []string) []proto.Message

Query returns the proto.Messages in the ListenerCache that match a slice of strings

func (*ListenerCache) TypeURL

func (*ListenerCache) TypeURL() string

func (*ListenerCache) Update

func (c *ListenerCache) Update(v map[string]*envoy_listener_v3.Listener)

Update replaces the contents of the cache with the supplied map.

type ListenerConfig

type ListenerConfig struct {

	// Envoy's HTTP (non TLS) listener addresses.
	// If not set, defaults to a single listener with
	// DEFAULT_HTTP_LISTENER_ADDRESS:DEFAULT_HTTP_LISTENER_PORT.
	HTTPListeners map[string]Listener

	// Envoy's HTTP (non TLS) access log path.
	// If not set, defaults to DEFAULT_HTTP_ACCESS_LOG.
	HTTPAccessLog string

	// Envoy's HTTPS (TLS) listener addresses.
	// If not set, defaults to a single listener with
	// DEFAULT_HTTPS_LISTENER_ADDRESS:DEFAULT_HTTPS_LISTENER_PORT.
	HTTPSListeners map[string]Listener

	// Envoy's HTTPS (TLS) access log path.
	// If not set, defaults to DEFAULT_HTTPS_ACCESS_LOG.
	HTTPSAccessLog string

	// UseProxyProto configures all listeners to expect a PROXY
	// V1 or V2 preamble.
	// If not set, defaults to false.
	UseProxyProto bool

	// MinimumTLSVersion defines the minimum TLS protocol version the proxy should accept.
	MinimumTLSVersion string

	// CipherSuites defines the ciphers Envoy TLS listeners will accept when
	// negotiating TLS 1.2.
	CipherSuites []string

	// DefaultHTTPVersions defines the default set of HTTP
	// versions the proxy should accept. If not specified, all
	// supported versions are accepted. This is applied to both
	// HTTP and HTTPS listeners but has practical effect only for
	// HTTPS, because we don't support h2c.
	DefaultHTTPVersions []envoy_v3.HTTPVersionType

	// AccessLogType defines if Envoy logs should be output as Envoy's default or JSON.
	// Valid values: 'envoy', 'json'
	// If not set, defaults to 'envoy'
	AccessLogType contour_api_v1alpha1.AccessLogType

	// AccessLogJSONFields sets the fields that should be shown in JSON logs.
	// Valid entries are the keys from internal/envoy/accesslog.go:jsonheaders
	// Defaults to a particular set of fields.
	AccessLogJSONFields contour_api_v1alpha1.AccessLogJSONFields

	// AccessLogFormatString sets the format string to be used for text based access logs.
	// Defaults to empty to defer to Envoy's default log format.
	AccessLogFormatString string

	// AccessLogFormatterExtensions defines the Envoy extensions to enable for access log.
	AccessLogFormatterExtensions []string

	// AccessLogLevel defines the logging level for access log.
	AccessLogLevel contour_api_v1alpha1.AccessLogLevel

	// Timeouts holds Listener timeout settings.
	Timeouts contourconfig.Timeouts

	// AllowChunkedLength enables setting allow_chunked_length on the HTTP1 options for all
	// listeners.
	AllowChunkedLength bool

	// MergeSlashes toggles Envoy's non-standard merge_slashes path transformation option for all listeners.
	MergeSlashes bool

	// ServerHeaderTransformation defines the action to be applied to the Server header on the response path.
	ServerHeaderTransformation contour_api_v1alpha1.ServerHeaderTransformationType

	// XffNumTrustedHops sets the number of additional ingress proxy hops from the
	// right side of the x-forwarded-for HTTP header to trust.
	XffNumTrustedHops uint32

	// ConnectionBalancer
	// The validated value is 'exact'.
	// If no configuration is specified, Envoy will not attempt to balance active connections between worker threads
	// If specified, the listener will use the exact connection balancer.
	ConnectionBalancer string
	// RateLimitConfig optionally configures the global Rate Limit Service to be
	// used.
	RateLimitConfig *RateLimitConfig
}

ListenerConfig holds configuration parameters for building Envoy Listeners.

type LoadBalancingEndpoint

type LoadBalancingEndpoint = envoy_endpoint_v3.LbEndpoint

func RecalculateEndpoints

func RecalculateEndpoints(port, healthPort v1.ServicePort, ep *v1.Endpoints) []*LoadBalancingEndpoint

RecalculateEndpoints generates a slice of LoadBalancingEndpoint resources by matching the given service port to the given v1.Endpoints. ep may be nil, in which case, the result is also nil.

type RateLimitConfig added in v1.13.0

type RateLimitConfig struct {
	ExtensionService            types.NamespacedName
	SNI                         string
	Domain                      string
	Timeout                     timeout.Setting
	FailOpen                    bool
	EnableXRateLimitHeaders     bool
	EnableResourceExhaustedCode bool
}

type RouteCache

type RouteCache struct {
	contour.Cond
	// contains filtered or unexported fields
}

RouteCache manages the contents of the gRPC RDS cache.

func (*RouteCache) Contents

func (c *RouteCache) Contents() []proto.Message

Contents returns a copy of the cache's contents.

func (*RouteCache) OnChange

func (c *RouteCache) OnChange(root *dag.DAG)

func (*RouteCache) Query

func (c *RouteCache) Query(names []string) []proto.Message

Query searches the RouteCache for the named RouteConfiguration entries.

func (*RouteCache) TypeURL

func (*RouteCache) TypeURL() string

TypeURL returns the string type of RouteCache Resource.

func (*RouteCache) Update

Update replaces the contents of the cache with the supplied map.

type RuntimeCache added in v1.21.0

type RuntimeCache struct {
	contour.Cond
}

RuntimeCache manages the contents of the gRPC RTDS cache.

func (*RuntimeCache) Contents added in v1.21.0

func (c *RuntimeCache) Contents() []proto.Message

Contents returns all Runtime layers.

func (*RuntimeCache) OnChange added in v1.21.0

func (c *RuntimeCache) OnChange(root *dag.DAG)

func (*RuntimeCache) Query added in v1.21.0

func (c *RuntimeCache) Query(names []string) []proto.Message

Query returns only the "dynamic" layer if requested, otherwise empty.

func (*RuntimeCache) TypeURL added in v1.21.0

func (*RuntimeCache) TypeURL() string

type SecretCache

type SecretCache struct {
	contour.Cond
	// contains filtered or unexported fields
}

SecretCache manages the contents of the gRPC SDS cache.

func NewSecretsCache added in v1.20.0

func NewSecretsCache(secrets []*envoy_tls_v3.Secret) *SecretCache

func (*SecretCache) Contents

func (c *SecretCache) Contents() []proto.Message

Contents returns a copy of the cache's contents.

func (*SecretCache) OnChange

func (c *SecretCache) OnChange(root *dag.DAG)

func (*SecretCache) Query

func (c *SecretCache) Query(names []string) []proto.Message

func (*SecretCache) TypeURL

func (*SecretCache) TypeURL() string

func (*SecretCache) Update

func (c *SecretCache) Update(v map[string]*envoy_tls_v3.Secret)

Update replaces the contents of the cache with the supplied map.

Jump to

Keyboard shortcuts

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