Documentation ¶
Index ¶
- Constants
- type ClusterCache
- type EndpointsCache
- type EndpointsTranslator
- func (e *EndpointsTranslator) Contents() []proto.Message
- func (e *EndpointsTranslator) Merge(entries map[string]*envoy_endpoint_v3.ClusterLoadAssignment)
- func (e *EndpointsTranslator) OnAdd(obj interface{})
- func (e *EndpointsTranslator) OnChange(root *dag.DAG)
- func (e *EndpointsTranslator) OnDelete(obj interface{})
- func (e *EndpointsTranslator) OnUpdate(oldObj, newObj interface{})
- func (e *EndpointsTranslator) Query(names []string) []proto.Message
- func (*EndpointsTranslator) TypeURL() string
- type Listener
- type ListenerCache
- type ListenerConfig
- type LoadBalancingEndpoint
- type LocalityEndpoints
- type RateLimitConfig
- type RouteCache
- type RuntimeCache
- type SecretCache
Constants ¶
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 ¶
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) 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 ¶
func (c *EndpointsCache) Recalculate() map[string]*envoy_endpoint_v3.ClusterLoadAssignment
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 ¶
func (e *EndpointsTranslator) Merge(entries map[string]*envoy_endpoint_v3.ClusterLoadAssignment)
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 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 // 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 contour_api_v1alpha1.AccessLogFields // 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 // 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 LocalityEndpoints ¶
type LocalityEndpoints = envoy_endpoint_v3.LocalityLbEndpoints
type RateLimitConfig ¶ added in v1.13.0
type RouteCache ¶
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 ¶
func (c *RouteCache) Update(v map[string]*envoy_route_v3.RouteConfiguration)
Update replaces the contents of the cache with the supplied map.
type RuntimeCache ¶ added in v1.21.0
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 an empty set of layers for now.
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 an empty set of layers for now.
func (*RuntimeCache) TypeURL ¶ added in v1.21.0
func (*RuntimeCache) TypeURL() string
type SecretCache ¶
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) 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.