xds

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLACache

type CLACache interface {
	GetCLA(ctx context.Context, meshName, meshHash string, cluster envoy_common.Cluster, apiVersion envoy_common.APIVersion) (proto.Message, error)
}

type CaSecret

type CaSecret struct {
	PemCerts [][]byte
}

type CircuitBreakerMap

type CircuitBreakerMap map[ServiceName]*mesh_core.CircuitBreakerResource

CircuitBreakerMap holds the most specific CircuitBreaker for each reachable service.

type DataplaneMetadata

type DataplaneMetadata struct {
	DataplaneTokenPath  string
	DataplaneToken      string
	DataplaneResource   *core_mesh.DataplaneResource
	ZoneIngressResource *core_mesh.ZoneIngressResource
	AdminPort           uint32
	DNSPort             uint32
	EmptyDNSPort        uint32
	DynamicMetadata     map[string]string
	ProxyType           mesh_proto.ProxyType
	Version             *mesh_proto.Version
}

DataplaneMetadata represents environment-specific part of a dataplane configuration.

This information might change from one dataplane run to another and therefore it cannot be a part of Dataplane resource.

On start-up, a dataplane captures its effective configuration (that might come from a file, environment variables and command line options) and includes it into request for a bootstrap config. Control Plane can use this information to fill in node metadata in the bootstrap config. Envoy will include node metadata from the bootstrap config at least into the very first discovery request on every xDS stream. This way, xDS server will be able to use Envoy node metadata to generate xDS resources that depend on environment-specific configuration.

func DataplaneMetadataFromXdsMetadata

func DataplaneMetadataFromXdsMetadata(xdsMetadata *_struct.Struct) *DataplaneMetadata

func (*DataplaneMetadata) GetAdminPort

func (m *DataplaneMetadata) GetAdminPort() uint32

func (*DataplaneMetadata) GetDNSPort

func (m *DataplaneMetadata) GetDNSPort() uint32

func (*DataplaneMetadata) GetDataplaneResource

func (m *DataplaneMetadata) GetDataplaneResource() *core_mesh.DataplaneResource

func (*DataplaneMetadata) GetDataplaneToken

func (m *DataplaneMetadata) GetDataplaneToken() string

func (*DataplaneMetadata) GetDataplaneTokenPath

func (m *DataplaneMetadata) GetDataplaneTokenPath() string

func (*DataplaneMetadata) GetDynamicMetadata

func (m *DataplaneMetadata) GetDynamicMetadata(key string) string

func (*DataplaneMetadata) GetEmptyDNSPort

func (m *DataplaneMetadata) GetEmptyDNSPort() uint32

func (*DataplaneMetadata) GetProxyType

func (m *DataplaneMetadata) GetProxyType() mesh_proto.ProxyType

func (*DataplaneMetadata) GetVersion

func (m *DataplaneMetadata) GetVersion() *mesh_proto.Version

func (*DataplaneMetadata) GetZoneIngressResource

func (m *DataplaneMetadata) GetZoneIngressResource() *core_mesh.ZoneIngressResource

type DestinationMap

type DestinationMap map[ServiceName]TagSelectorSet

DestinationMap holds a set of selectors for all reachable Dataplanes grouped by service name. DestinationMap is based on ServiceName and not on the OutboundInterface because TrafficRoute can introduce new service destinations that were not included in a outbound section. Policies that match on outbound connections also match by service destination name and not outbound interface for the same reason.

type Endpoint

type Endpoint struct {
	Target          string
	Port            uint32
	Tags            map[string]string
	Weight          uint32
	Locality        *Locality
	ExternalService *ExternalService
}

Endpoint holds routing-related information about a single endpoint.

func (Endpoint) ContainsTags

func (e Endpoint) ContainsTags(tags map[string]string) bool

ContainsTags returns 'true' if for every key presented both in 'tags' and 'Endpoint#Tags' values are equal

func (Endpoint) HasLocality

func (e Endpoint) HasLocality() bool

func (Endpoint) IsExternalService

func (e Endpoint) IsExternalService() bool

func (Endpoint) LocalityString

func (e Endpoint) LocalityString() string

type EndpointList

type EndpointList []Endpoint

EndpointList is a list of Endpoints with convenience methods.

func (EndpointList) Filter

func (l EndpointList) Filter(selector mesh_proto.TagSelector) EndpointList

type EndpointMap

type EndpointMap map[ServiceName][]Endpoint

EndpointMap holds routing-related information about a set of endpoints grouped by service name.

type ExternalService

type ExternalService struct {
	TLSEnabled         bool
	CaCert             []byte
	ClientCert         []byte
	ClientKey          []byte
	AllowRenegotiation bool
}

type FaultInjectionMap

FaultInjectionMap holds the most specific FaultInjectionResource for each InboundInterface

type HealthCheckMap

type HealthCheckMap map[ServiceName]*mesh_core.HealthCheckResource

HealthCheckMap holds the most specific HealthCheck for each reachable service.

type IdentitySecret

type IdentitySecret struct {
	PemCerts [][]byte
	PemKey   []byte
}

type Locality

type Locality struct {
	Region   string
	Zone     string
	SubZone  string
	Priority uint32
}

type LogMap

LogMap holds the most specific TrafficLog for each outbound interface of a Dataplane.

type MatchedPolicies

type MatchedPolicies struct {
	TrafficPermissions TrafficPermissionMap
	Logs               LogMap
	HealthChecks       HealthCheckMap
	CircuitBreakers    CircuitBreakerMap
	Retries            RetryMap
	TrafficTrace       *mesh_core.TrafficTraceResource
	TracingBackend     *mesh_proto.TracingBackend
	FaultInjections    FaultInjectionMap
	Timeouts           TimeoutMap
	RateLimits         RateLimitsMap
}

type Proxy

type Proxy struct {
	Id          ProxyId
	APIVersion  envoy_common.APIVersion // todo(jakubdyszkiewicz) consider moving APIVersion here. pkg/core should not depend on pkg/xds. It should be other way around.
	Dataplane   *mesh_core.DataplaneResource
	ZoneIngress *mesh_core.ZoneIngressResource
	Metadata    *DataplaneMetadata
	Routing     Routing
	Policies    MatchedPolicies
}

type ProxyId

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

func BuildProxyId

func BuildProxyId(mesh, name string) *ProxyId

func FromResourceKey

func FromResourceKey(key core_model.ResourceKey) ProxyId

func ParseProxyIdFromString

func ParseProxyIdFromString(id string) (*ProxyId, error)

func (*ProxyId) String

func (id *ProxyId) String() string

func (*ProxyId) ToResourceKey

func (id *ProxyId) ToResourceKey() core_model.ResourceKey

type RateLimitsMap

type RateLimitsMap map[mesh_proto.InboundInterface][]*mesh_proto.RateLimit

RateLimitsMap holds all RateLimitResources for each InboundInterface

type Resource

type Resource struct {
	Name     string
	Origin   string
	Resource ResourcePayload
}

Resource represents a generic xDS resource with name and version.

type ResourceList

type ResourceList []*Resource

ResourceList represents a list of generic xDS resources.

func (ResourceList) Len

func (rs ResourceList) Len() int

func (ResourceList) Less

func (rs ResourceList) Less(i, j int) bool

func (ResourceList) Payloads

func (rs ResourceList) Payloads() []ResourcePayload

func (ResourceList) Swap

func (rs ResourceList) Swap(i, j int)

func (ResourceList) ToDeltaDiscoveryResponse

func (rs ResourceList) ToDeltaDiscoveryResponse() (*envoy.DeltaDiscoveryResponse, error)

func (ResourceList) ToIndex

func (rs ResourceList) ToIndex() map[string]ResourcePayload

type ResourcePayload

type ResourcePayload = envoy_types.Resource

ResourcePayload is a convenience type alias.

type ResourceSet

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

ResourceSet represents a set of generic xDS resources.

func NewResourceSet

func NewResourceSet() *ResourceSet

func (*ResourceSet) Add

func (s *ResourceSet) Add(resources ...*Resource) *ResourceSet

func (*ResourceSet) AddSet

func (s *ResourceSet) AddSet(set *ResourceSet) *ResourceSet

func (*ResourceSet) Contains

func (s *ResourceSet) Contains(name string, resource ResourcePayload) bool

func (*ResourceSet) Empty

func (s *ResourceSet) Empty() bool

func (*ResourceSet) List

func (s *ResourceSet) List() ResourceList

func (*ResourceSet) ListOf

func (s *ResourceSet) ListOf(typ string) ResourceList

func (*ResourceSet) Remove

func (s *ResourceSet) Remove(typ string, name string)

func (*ResourceSet) Resources

func (s *ResourceSet) Resources(typ string) map[string]*Resource

type RetryMap

type RetryMap map[ServiceName]*mesh_core.RetryResource

RetryMap holds the most specific Retry for each reachable service.

type RouteMap

RouteMap holds the most specific TrafficRoute for each outbound interface of a Dataplane.

type Routing

type Routing struct {
	TrafficRoutes   RouteMap
	OutboundTargets EndpointMap

	// todo(lobkovilya): split Proxy struct into DataplaneProxy and IngressProxy
	// TrafficRouteList is used only for generating configs for Ingress.
	TrafficRouteList *mesh_core.TrafficRouteResourceList
}

type ServiceName

type ServiceName = string

ServiceName is a convenience type alias to clarify the meaning of string value.

type SocketAddressProtocol

type SocketAddressProtocol int32

SocketAddressProtocol is the L4 protocol the listener should bind to

const (
	SocketAddressProtocolTCP SocketAddressProtocol = 0
	SocketAddressProtocolUDP SocketAddressProtocol = 1
)

type StreamID

type StreamID = int64

StreamID represents a stream opened by XDS

type TagSelectorSet

type TagSelectorSet []mesh_proto.TagSelector

TagSelectorSet is a set of unique TagSelectors.

func (TagSelectorSet) Add

func (TagSelectorSet) Matches

func (s TagSelectorSet) Matches(tags map[string]string) bool

type TimeoutMap

TimeoutMap holds the most specific TimeoutResource for each OutboundInterface

type TrafficPermissionMap

TrafficPermissionMap holds the most specific TrafficPermissionResource for each InboundInterface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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