Documentation ¶
Index ¶
- Constants
- func AccessLogSocketName(tmpDir, name, mesh string) string
- func MetricsHijackerSocketName(tmpDir, name, mesh string) string
- type APIVersion
- type CaRequest
- type DataplaneMetadata
- func (m *DataplaneMetadata) GetAdminAddress() string
- func (m *DataplaneMetadata) GetAdminPort() uint32
- func (m *DataplaneMetadata) GetDNSPort() uint32
- func (m *DataplaneMetadata) GetDataplaneResource() *core_mesh.DataplaneResource
- func (m *DataplaneMetadata) GetDynamicMetadata(key string) string
- func (m *DataplaneMetadata) GetEmptyDNSPort() uint32
- func (m *DataplaneMetadata) GetProxyType() mesh_proto.ProxyType
- func (m *DataplaneMetadata) GetZoneIngressResource() *core_mesh.ZoneIngressResource
- type DestinationMap
- type Endpoint
- type EndpointList
- type EndpointMap
- type ExternalService
- type ExternalServiceDynamicPolicies
- type Features
- type IdentityCertRequest
- type Locality
- type MatchedPolicies
- type MeshIngressResources
- type MeshName
- type PluginOriginatedPolicies
- type Proxy
- type ProxyId
- type Resource
- type ResourceList
- func (rs ResourceList) Len() int
- func (rs ResourceList) Less(i, j int) bool
- func (rs ResourceList) Payloads() []ResourcePayload
- func (rs ResourceList) Swap(i, j int)
- func (rs ResourceList) ToDeltaDiscoveryResponse() (*envoy_sd.DeltaDiscoveryResponse, error)
- func (rs ResourceList) ToIndex() map[string]ResourcePayload
- type ResourcePayload
- type ResourceSet
- func (s *ResourceSet) Add(resources ...*Resource) *ResourceSet
- func (s *ResourceSet) AddSet(set *ResourceSet) *ResourceSet
- func (s *ResourceSet) Contains(name string, resource ResourcePayload) bool
- func (s *ResourceSet) Empty() bool
- func (s *ResourceSet) List() ResourceList
- func (s *ResourceSet) ListOf(typ string) ResourceList
- func (s *ResourceSet) Remove(typ string, name string)
- func (s *ResourceSet) ResourceTypes() []string
- func (s *ResourceSet) Resources(typ string) map[string]*Resource
- type Routing
- type SecretsTracker
- type ServerSideTLSCertPaths
- type ServiceName
- type SocketAddressProtocol
- type StreamID
- type TagSelectorSet
- type TypedMatchingPolicies
- type ZoneIngressProxy
Constants ¶
const ( // Supported Envoy node metadata fields. FieldDataplaneAdminPort = "dataplane.admin.port" FieldDataplaneAdminAddress = "dataplane.admin.address" FieldDataplaneDNSPort = "dataplane.dns.port" FieldDataplaneDNSEmptyPort = "dataplane.dns.empty.port" FieldDataplaneDataplaneResource = "dataplane.resource" FieldDynamicMetadata = "dynamicMetadata" FieldDataplaneProxyType = "dataplane.proxyType" FieldPrefixDependenciesVersion = "version.dependencies" FieldVersion = "version" FieldFeatures = "features" FieldWorkdir = "workdir" FieldAccessLogSocketPath = "accessLogSocketPath" FieldMetricsSocketPath = "metricsSocketPath" FieldMetricsCertPath = "metricsCertPath" FieldMetricsKeyPath = "metricsKeyPath" )
const FeatureTCPAccessLogViaNamedPipe string = "feature-tcp-accesslog-via-named-pipe"
FeatureTCPAccessLogViaNamedPipe indicates that the DP implements TCP accesslog across a named pipe. Sotw DP versions may use structured data across GRPC.
Variables ¶
This section is empty.
Functions ¶
func AccessLogSocketName ¶
AccessLogSocketName generates a socket path that will fit the Unix socket path limitation of 104 chars
func MetricsHijackerSocketName ¶
MetricsHijackerSocketName generates a socket path that will fit the Unix socket path limitation of 104 chars
Types ¶
type APIVersion ¶
type APIVersion string
type DataplaneMetadata ¶
type DataplaneMetadata struct { Resource model.Resource AdminPort uint32 AdminAddress string DNSPort uint32 EmptyDNSPort uint32 DynamicMetadata map[string]string ProxyType mesh_proto.ProxyType Features Features WorkDir string AccessLogSocketPath string MetricsSocketPath string MetricsCertPath string MetricsKeyPath string }
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, tmpDir string, dpKey model.ResourceKey) *DataplaneMetadata
func (*DataplaneMetadata) GetAdminAddress ¶
func (m *DataplaneMetadata) GetAdminAddress() string
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) 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 ¶
ContainsTags returns 'true' if for every key presented both in 'tags' and 'Endpoint#Tags' values are equal
func (Endpoint) HasLocality ¶
func (Endpoint) IsExternalService ¶
func (Endpoint) IsReachableFromZone ¶
if false endpoint should be accessed through zoneIngress of other zone
func (Endpoint) LocalityString ¶
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 ExternalServiceDynamicPolicies ¶
type ExternalServiceDynamicPolicies map[ServiceName]PluginOriginatedPolicies
type Features ¶
Features is a set of features which a data plane has enabled.
func (Features) HasFeature ¶
HasFeature returns true iff the feature string appears in the feature list.
type IdentityCertRequest ¶
type IdentityCertRequest interface {
Name() string
}
type MatchedPolicies ¶
type MatchedPolicies struct {
Dynamic PluginOriginatedPolicies
}
type MeshIngressResources ¶
type MeshIngressResources struct { Mesh *core_mesh.MeshResource EndpointMap EndpointMap Resources map[core_model.ResourceType]core_model.ResourceList }
type PluginOriginatedPolicies ¶
type PluginOriginatedPolicies map[core_model.ResourceType]TypedMatchingPolicies
type Proxy ¶
type Proxy struct { Id ProxyId APIVersion APIVersion Dataplane *core_mesh.DataplaneResource Metadata *DataplaneMetadata Routing Routing Policies MatchedPolicies // SecretsTracker allows us to track when a generator references a secret so // we can be sure to include only those secrets later on. SecretsTracker SecretsTracker // ZoneIngressProxy is available only when XDS is generated for ZoneIngress data plane proxy. ZoneIngressProxy *ZoneIngressProxy // RuntimeExtensions a set of extensions to add for custom extensions RuntimeExtensions map[string]interface{} // Zone the zone the proxy is in Zone string }
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 FromResourceKey ¶
func FromResourceKey(key core_model.ResourceKey) ProxyId
func ParseProxyIdFromString ¶
func (*ProxyId) ToResourceKey ¶
func (id *ProxyId) ToResourceKey() core_model.ResourceKey
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 ¶
func (s *ResourceSet) ResourceTypes() []string
ResourceTypes returns names of all the distinct resource types in the set.
type Routing ¶
type Routing struct { OutboundTargets EndpointMap // ExternalServiceOutboundTargets contains endpoint map for direct access of external services (without egress) // Since we take into account TrafficPermission to exclude external services from the map, // it is specific for each data plane proxy. ExternalServiceOutboundTargets EndpointMap }
type SecretsTracker ¶
type SecretsTracker interface { RequestIdentityCert() IdentityCertRequest RequestCa(mesh string) CaRequest RequestAllInOneCa() CaRequest UsedIdentity() bool UsedCas() map[string]struct{} UsedAllInOne() bool }
SecretsTracker provides a way to ask for a secret and keeps track of which are used, so that they can later be generated and included in the resources.
type ServerSideTLSCertPaths ¶
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 TagSelectorSet ¶
type TagSelectorSet []mesh_proto.TagSelector
TagSelectorSet is a set of unique TagSelectors.
func (TagSelectorSet) Add ¶
func (s TagSelectorSet) Add(new mesh_proto.TagSelector) TagSelectorSet
type TypedMatchingPolicies ¶
type TypedMatchingPolicies struct { Type core_model.ResourceType InboundPolicies map[mesh_proto.InboundInterface][]core_model.Resource OutboundPolicies map[mesh_proto.OutboundInterface][]core_model.Resource ServicePolicies map[ServiceName][]core_model.Resource DataplanePolicies []core_model.Resource }
TypedMatchingPolicies all policies of this type matching
type ZoneIngressProxy ¶
type ZoneIngressProxy struct { ZoneIngressResource *core_mesh.ZoneIngressResource MeshResourceList []*MeshIngressResources }