clusters

package
v0.0.0-...-7b34d14 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterBuilder

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

ClusterBuilder is responsible for generating an Envoy cluster by applying a series of ClusterConfigurers.

func NewClusterBuilder

func NewClusterBuilder() *ClusterBuilder

func (*ClusterBuilder) Build

func (b *ClusterBuilder) Build() (*envoy_api.Cluster, error)

Build generates an Envoy cluster by applying a series of ClusterConfigurers.

func (*ClusterBuilder) Configure

func (b *ClusterBuilder) Configure(opts ...ClusterBuilderOpt) *ClusterBuilder

Configure configures ClusterBuilder by adding individual ClusterConfigurers.

type ClusterBuilderConfig

type ClusterBuilderConfig struct {
	// A series of ClusterConfigurers to apply to Envoy cluster.
	Configurers []ClusterConfigurer
}

ClusterBuilderConfig holds configuration of a ClusterBuilder.

func (*ClusterBuilderConfig) Add

func (c *ClusterBuilderConfig) Add(configurer ClusterConfigurer)

Add appends a given ClusterConfigurer to the end of the chain.

type ClusterBuilderOpt

type ClusterBuilderOpt interface {
	// ApplyTo adds ClusterConfigurer(s) to the ClusterBuilder.
	ApplyTo(config *ClusterBuilderConfig)
}

ClusterBuilderOpt is a configuration option for ClusterBuilder.

The goal of ClusterBuilderOpt is to facilitate fluent ClusterBuilder API.

func AltStatName

func AltStatName() ClusterBuilderOpt

func ClientSideMTLS

func ClientSideMTLS(ctx xds_context.Context, metadata *core_xds.DataplaneMetadata, clientService string, tags []envoy.Tags) ClusterBuilderOpt

func ConnectTimeout

func ConnectTimeout(timeout time.Duration) ClusterBuilderOpt

func EdsCluster

func EdsCluster(name string) ClusterBuilderOpt

func HealthCheck

func HealthCheck(healthCheck *mesh_core.HealthCheckResource) ClusterBuilderOpt

func OutlierDetection

func OutlierDetection(circuitBreaker *mesh_core.CircuitBreakerResource) ClusterBuilderOpt

func PassThroughCluster

func PassThroughCluster(name string) ClusterBuilderOpt

func StaticCluster

func StaticCluster(name string, address string, port uint32) ClusterBuilderOpt

func UnknownDestinationClientSideMTLS

func UnknownDestinationClientSideMTLS(ctx xds_context.Context, metadata *core_xds.DataplaneMetadata) ClusterBuilderOpt

UnknownDestinationClientSideMTLS configures cluster with mTLS for a mesh but without extensive destination verification (only Mesh is verified)

type ClusterBuilderOptFunc

type ClusterBuilderOptFunc func(config *ClusterBuilderConfig)

ClusterBuilderOptFunc is a convenience type adapter.

func LbSubset

func LbSubset(keySets [][]string) ClusterBuilderOptFunc

LbSubset is required for MetadataMatch in Weighted Cluster in TCP Proxy to work. Subset loadbalancing is used in two use cases

  1. TrafficRoute for splitting traffic. Example: TrafficRoute that splits 10% of the traffic to version 1 of the service backend and 90% traffic to version 2 of the service backend
  2. Multiple outbound sections with the same service Example: type: Dataplane networking: outbound: - port: 1234 tags: service: backend - port: 1234 tags: service: backend version: v1 Only one cluster "backend" is generated for such dataplane, but with lb subset by version.

func (ClusterBuilderOptFunc) ApplyTo

func (f ClusterBuilderOptFunc) ApplyTo(config *ClusterBuilderConfig)

type ClusterConfigurer

type ClusterConfigurer interface {
	// Configure configures a single aspect on a given Envoy cluster.
	Configure(cluster *envoy_api.Cluster) error
}

ClusterConfigurer is responsible for configuring a single aspect of the entire Envoy cluster, such as filter chain, transparent proxying, etc.

type OutlierDetectionConfigurer

type OutlierDetectionConfigurer struct {
	CircuitBreaker *mesh_core.CircuitBreakerResource
}

func (*OutlierDetectionConfigurer) Configure

func (c *OutlierDetectionConfigurer) Configure(cluster *envoy_api.Cluster) error

Jump to

Keyboard shortcuts

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