xds

package
v1.5.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldPrefixDependenciesVersion = "version.dependencies"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment added in v1.8.1

type Attachment struct {
	Type AttachmentType
	Name string
	// Service indicates service for the attachments.
	// For Dataplane AttachmentType it's empty since we are not matching to a specific service.
	Service string
}

type AttachmentList added in v1.8.1

type AttachmentList []Attachment

func (AttachmentList) Len added in v1.8.1

func (a AttachmentList) Len() int

func (AttachmentList) Less added in v1.8.1

func (a AttachmentList) Less(i, j int) bool

func (AttachmentList) Swap added in v1.8.1

func (a AttachmentList) Swap(i, j int)

type AttachmentMap added in v1.8.1

type AttachmentMap map[Attachment]PoliciesByResourceType

func GroupByAttachment added in v1.8.1

func GroupByAttachment(matchedPolicies *MatchedPolicies, networking *mesh_proto.Dataplane_Networking) AttachmentMap

type AttachmentType added in v1.8.1

type AttachmentType int64
const (
	Inbound AttachmentType = iota
	Outbound
	Service
	Dataplane
)

func (AttachmentType) String added in v1.8.1

func (s AttachmentType) String() string

type Attachments added in v1.8.1

type Attachments map[Attachment][]core_model.Resource

func BuildAttachments added in v1.8.1

func BuildAttachments(matchedPolicies *MatchedPolicies, networking *mesh_proto.Dataplane_Networking) Attachments

type AttachmentsByPolicy added in v1.8.1

type AttachmentsByPolicy map[PolicyKey]AttachmentList

func GroupByPolicy added in v1.8.1

func GroupByPolicy(matchedPolicies *MatchedPolicies, networking *mesh_proto.Dataplane_Networking) AttachmentsByPolicy

func (AttachmentsByPolicy) Merge added in v1.8.1

func (abp AttachmentsByPolicy) Merge(other AttachmentsByPolicy)

type CLACache

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

type CaSecret

type CaSecret struct {
	PemCerts [][]byte
}

type CircuitBreakerMap

type CircuitBreakerMap map[ServiceName]*core_mesh.CircuitBreakerResource

CircuitBreakerMap holds the most specific CircuitBreaker for each reachable service.

type DataplaneMetadata

type DataplaneMetadata struct {
	Resource        model.Resource
	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 *structpb.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

GetDataplaneResource returns the underlying DataplaneResource, if present. If the resource is of a different type, it returns nil.

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) GetZoneEgressResource added in v1.8.1

func (m *DataplaneMetadata) GetZoneEgressResource() *core_mesh.ZoneEgressResource

GetZoneEgressResource returns the underlying ZoneEgressResource, if present. If the resource is of a different type, it returns nil.

func (*DataplaneMetadata) GetZoneIngressResource

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

GetZoneIngressResource returns the underlying ZoneIngressResource, if present. If the resource is of a different type, it returns nil.

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
	UnixDomainPath  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
	ServerName         string
}

type ExternalServicePermissionMap added in v1.8.1

type ExternalServicePermissionMap map[ServiceName]*core_mesh.TrafficPermissionResource

type FaultInjectionMap

FaultInjectionMap holds all matched FaultInjectionResources for each InboundInterface

type HealthCheckMap

type HealthCheckMap map[ServiceName]*core_mesh.HealthCheckResource

HealthCheckMap holds the most specific HealthCheck for each reachable service.

type IdentitySecret

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

type InboundRateLimitsMap added in v1.8.1

type InboundRateLimitsMap map[mesh_proto.InboundInterface][]*core_mesh.RateLimitResource

InboundRateLimitsMap holds all RateLimitResources for each InboundInterface

type Locality

type Locality struct {
	Zone     string
	Priority uint32
}

type MatchedPolicies

type MatchedPolicies struct {
	// Inbound(Listener) -> Policy
	TrafficPermissions    TrafficPermissionMap
	FaultInjections       FaultInjectionMap
	RateLimitsInbound     InboundRateLimitsMap
	CustomInboundPolicies []map[mesh_proto.InboundInterface]core_model.Resource

	// Service(Cluster) -> Policy
	TrafficLogs     TrafficLogMap
	HealthChecks    HealthCheckMap
	CircuitBreakers CircuitBreakerMap
	Retries         RetryMap

	// Outbound(Listener) -> Policy
	Timeouts           TimeoutMap
	RateLimitsOutbound OutboundRateLimitsMap
	// Actual Envoy Configuration is generated without taking this TrafficRoutes into account
	TrafficRoutes RouteMap

	// Dataplane -> Policy
	TrafficTrace *core_mesh.TrafficTraceResource
	// Actual Envoy Configuration is generated without taking this ProxyTemplate into account
	ProxyTemplate *core_mesh.ProxyTemplateResource
}

type MeshResources added in v1.8.1

type MeshResources struct {
	Mesh                         *core_mesh.MeshResource
	TrafficRoutes                []*core_mesh.TrafficRouteResource
	ExternalServices             []*core_mesh.ExternalServiceResource
	ExternalServicePermissionMap ExternalServicePermissionMap
	EndpointMap                  EndpointMap
}

type OutboundRateLimitsMap added in v1.8.1

type OutboundRateLimitsMap map[mesh_proto.OutboundInterface]*core_mesh.RateLimitResource

OutboundRateLimitsMap holds the RateLimitResource for each OutboundInterface

type PoliciesByResourceType added in v1.8.1

type PoliciesByResourceType map[core_model.ResourceType][]core_model.Resource

type PolicyKey added in v1.8.1

type PolicyKey struct {
	Type core_model.ResourceType
	Key  core_model.ResourceKey
}

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   *core_mesh.DataplaneResource
	ZoneIngress *core_mesh.ZoneIngressResource
	Metadata    *DataplaneMetadata
	Routing     Routing
	Policies    MatchedPolicies

	// ZoneEgressProxy is available only when XDS is generated for ZoneEgress data plane proxy.
	ZoneEgressProxy *ZoneEgressProxy
	// ZoneIngressProxy is available only when XDS is generated for ZoneIngress data plane proxy.
	ZoneIngressProxy *ZoneIngressProxy
}

Proxy contains required data for generating XDS config that is specific to a data plane proxy. The data that is specific for the whole mesh should go into MeshContext.

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 struct {
	Inbound  InboundRateLimitsMap
	Outbound OutboundRateLimitsMap
}

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_sd.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) ResourceTypes added in v1.8.1

func (s *ResourceSet) ResourceTypes() []string

ResourceTypes returns names of all the distinct resource types in the set.

func (*ResourceSet) Resources

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

type RetryMap

type RetryMap map[ServiceName]*core_mesh.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
}

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 TrafficLogMap added in v1.8.1

type TrafficLogMap map[ServiceName]*core_mesh.TrafficLogResource

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

type TrafficPermissionMap

TrafficPermissionMap holds the most specific TrafficPermissionResource for each InboundInterface

type VIPDomains added in v1.8.1

type VIPDomains struct {
	Address string
	Domains []string
}

type ZoneEgressProxy added in v1.8.1

type ZoneEgressProxy struct {
	ZoneEgressResource *core_mesh.ZoneEgressResource
	ZoneIngresses      []*core_mesh.ZoneIngressResource
	MeshResourcesList  []*MeshResources
}

type ZoneIngressProxy added in v1.8.1

type ZoneIngressProxy struct {
	TrafficRouteList *core_mesh.TrafficRouteResourceList
	GatewayRoutes    *core_mesh.MeshGatewayRouteResourceList
}

Jump to

Keyboard shortcuts

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