Documentation ¶
Index ¶
- Constants
- type AuthzConfig
- type Cluster
- type ClusterCircuitBreakerConfig
- type ClusterConfig
- type ClusterHealthCheckConfig
- type Endpoint
- type EndpointConfig
- type FaultConfig
- type Listener
- type ListenerConfig
- type Node
- func (n *Node) AddCluster(clusters ...Cluster)
- func (n *Node) AddEndpoints(cluster string, eps ...Endpoint)
- func (n *Node) AddListener(lis ...*v2.Listener)
- func (n *Node) AddRoute(routeName string, vhosts ...route.VirtualHost)
- func (n *Node) Clusters() (cls []cache.Resource)
- func (n *Node) Endpoints() (eps []cache.Resource)
- func (n *Node) Listeners() (ls []cache.Resource)
- func (n *Node) Routes() (rs []cache.Resource)
- type ServiceProvider
- type Updater
- type VHostConfig
Constants ¶
const ( // AnnotationHealthCheckPath specifies the HTTP Path for health-checks AnnotationHealthCheckPath = "healthcheck.path" // AnnotationHealthInterval specifies the health check interval in milliseconds AnnotationHealthInterval = "healthcheck.interval" // AnnotationHealthCacheDuration specifies the health check cache duration in milliseconds AnnotationHealthCacheDuration = "healthcheck.cache" // AnnotationHealthTimeout specifies the timeout of a health-check in milliseconds AnnotationHealthTimeout = "healthcheck.timeout" // AnnotationHealthPort specifies the tcp port for the health-check AnnotationHealthPort = "healthcheck.port" // AnnotationHealthExpectedStatus specifies the accepted status codes AnnotationHealthExpectedStatus = "healthcheck.expected-status" // AnnotaionCBMaxConn sets the maximum number of connections that Envoy will make to the upstream AnnotaionCBMaxConn = "circuit-breaker.max-connections" // AnnotaionCBMaxPending sets the maximum number of pending requests that Envoy will // allow to the upstream cluster AnnotaionCBMaxPending = "circuit-breaker.max-pending" // AnnotaionCBMaxRequests sets the maximum number of parallel requests AnnotaionCBMaxRequests = "circuit-breaker.max-requests" // AnnotaionCBMaxRetries sets maximum number of parallel retries that Envoy // will allow to the upstream cluster AnnotaionCBMaxRetries = "circuit-breaker.max-retries" // AnnotaionEndpointWeight specifies the loadbalancer weight of the endpoint AnnotaionEndpointWeight = "endpoint.weight" // AnnotaionFaultInject enables fault injection AnnotaionFaultInject = "fault.inject" // AnnotaionFaultDelayPercent int value, specifies the delay injection percentage AnnotaionFaultDelayPercent = "fault.delay.percent" // AnnotaionFaultDelayDuration in milliseconds AnnotaionFaultDelayDuration = "fault.delay.duration" // AnnotaionFaultAbortPercent int value, specifies the abort injection percentage AnnotaionFaultAbortPercent = "fault.abort.percent" // AnnotaionFaultAbortCode specify the response status code AnnotaionFaultAbortCode = "fault.abort.code" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthzConfig ¶
type AuthzConfig struct {
Cluster string
}
AuthzConfig defines the behavior of the Authz HTTP Filter
type Cluster ¶
Cluster represents a group of endpoints
func (Cluster) Config ¶
func (c Cluster) Config() ClusterConfig
Config parses the annotations of the cluster and return a cluster config
type ClusterCircuitBreakerConfig ¶
type ClusterCircuitBreakerConfig struct { MaxConnections uint32 MaxPendingRequests uint32 MaxRequests uint32 MaxRetries uint32 }
ClusterCircuitBreakerConfig defines the circuit-breaker behavior of a cluster
type ClusterConfig ¶
type ClusterConfig struct { HealthCheck ClusterHealthCheckConfig CircuitBreaker ClusterCircuitBreakerConfig // for now, the cluster specifies the fault configuration // of the INGRESS traffic FaultConfig FaultConfig }
ClusterConfig defines the cluster behavior this config is filled by annotations
type ClusterHealthCheckConfig ¶
type ClusterHealthCheckConfig struct { Path string Timeout time.Duration Interval time.Duration CacheDuration time.Duration Port uint32 ExpectedStatusLower int64 ExpectedStatusUpper int64 }
ClusterHealthCheckConfig defines the health-checking behavior of a cluster
type Endpoint ¶
type Endpoint struct { Address string `yaml:"address"` Annotations map[string]string `yaml:"annotations"` Port uint32 `yaml:"port"` }
Endpoint represents a address/port combination
func (Endpoint) Config ¶
func (e Endpoint) Config() EndpointConfig
Config parses the endpoints annotations and returns the endpoint config
type EndpointConfig ¶
type EndpointConfig struct {
Weight uint32
}
EndpointConfig defines the behavior of a endpoint
type FaultConfig ¶
type FaultConfig struct { Enabled bool DelayDuration time.Duration DelayChance uint32 AbortCode uint32 AbortChance uint32 }
FaultConfig defines the behavior of the fault HTTP filter
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener is a builder type for an envoy v2.Listener
func NewListener ¶
func NewListener(cfg ListenerConfig) *Listener
NewListener constructs a new Listener
func (Listener) InjectAuthz ¶
func (l Listener) InjectAuthz(cfg AuthzConfig)
InjectAuthz prepends the authz filter to the http filter chain order matters!
func (Listener) InjectFault ¶
func (l Listener) InjectFault(cfg FaultConfig)
InjectFault prepends the fault injection filter into the http filter chain order matters!
func (Listener) InjectHealthCheckCache ¶
InjectHealthCheckCache prependas a http health check cache into the http filter chain order matters!
type ListenerConfig ¶
type ListenerConfig struct { // Name specifies the name of the listener Name string // TracingOperation specifies the traffic direction TracingOperation hcm.HttpConnectionManager_Tracing_OperationName // TargetRoute specifies the route which is associated with this listener TargetRoute string // Address specifies the IP address the listener listens on Address string // Port specifies the port the listener listens on Port uint32 }
ListenerConfig defines the listener behavior
type Node ¶
type Node struct { Name string // contains filtered or unexported fields }
Node holds the actual envoy-related data and acts only as a proxy type
func (*Node) AddCluster ¶
AddCluster initializes a cluster and calls AddEndpoints
func (*Node) AddEndpoints ¶
AddEndpoints initializes a ClusterLoadAssigment and appends a bunch of endpoints to it
func (*Node) AddListener ¶
AddListener adds a bunch of listeners
func (*Node) AddRoute ¶
func (n *Node) AddRoute(routeName string, vhosts ...route.VirtualHost)
AddRoute initializes a route config and appends a bunch of vhosts to it a vhost is unique per route and must not be duplicated this function takes care of it
type ServiceProvider ¶
type ServiceProvider interface { // GetClusters provides a list of endpoints per node GetClusters() (map[string][]Cluster, error) }
ServiceProvider abstracts the provider from the mesh implementation
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater is the glue between the provider-specific implementation and the snapshot cache The updater requests the services, endpoints and nodes from the provider, transforms them into the envoy typespace and puts them into the cache
func NewUpdater ¶
func NewUpdater(config cache.SnapshotCache, provider ServiceProvider) *Updater
NewUpdater returns a new Updater
type VHostConfig ¶
VHostConfig defines the VHost target cluster