v3

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 27 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:golint

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)

DeleteEndpoint deletes ep from the cache. Any ServiceClusters that are backed by a Service that ep belongs become stale.

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)

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.

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(d *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 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(config ListenerConfig, address string, port 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 address.
	// If not set, defaults to DEFAULT_HTTP_LISTENER_ADDRESS.
	HTTPAddress string

	// Envoy's HTTP (non TLS) listener port.
	// If not set, defaults to DEFAULT_HTTP_LISTENER_PORT.
	HTTPPort int

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

	// Envoy's HTTPS (TLS) listener address.
	// If not set, defaults to DEFAULT_HTTPS_LISTENER_ADDRESS.
	HTTPSAddress string

	// Envoy's HTTPS (TLS) listener port.
	// If not set, defaults to DEFAULT_HTTPS_LISTENER_PORT.
	HTTPSPort int

	// 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 config.AccessLogType

	// AccessLogFields 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.
	AccessLogFields config.AccessLogFields

	// RequestTimeout configures the request_timeout for all Connection Managers.
	RequestTimeout timeout.Setting

	// ConnectionIdleTimeout configures the common_http_protocol_options.idle_timeout for all
	// Connection Managers.
	ConnectionIdleTimeout timeout.Setting

	// StreamIdleTimeout configures the stream_idle_timeout for all Connection Managers.
	StreamIdleTimeout timeout.Setting

	// DelayedCloseTimeout configures the delayed_close_timeout for all Connection Managers.
	DelayedCloseTimeout timeout.Setting

	// MaxConnectionDuration configures the common_http_protocol_options.max_connection_duration for all
	// Connection Managers.
	MaxConnectionDuration timeout.Setting

	// ConnectionShutdownGracePeriod configures the drain_timeout for all Connection Managers.
	ConnectionShutdownGracePeriod timeout.Setting

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

	// 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 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
	Domain           string
	Timeout          timeout.Setting
	FailOpen         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 SecretCache

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

SecretCache manages the contents of the gRPC SDS cache.

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