Documentation ¶
Overview ¶
Package catalog implements the MeshCataloger interface, which forms the central component in OSM that transforms outputs from all other components (SMI policies, Kubernetes services, endpoints etc.) into configuration that is consumed by the the proxy control plane component to program sidecar proxies. Reference: https://github.com/kpbaseten/bookstore/blob/main/DESIGN.md#5-mesh-catalog
Index ¶
- Constants
- type MeshCatalog
- func (mc *MeshCatalog) GetEgressClusterConfigs(serviceIdentity identity.ServiceIdentity) ([]*trafficpolicy.EgressClusterConfig, error)
- func (mc *MeshCatalog) GetEgressHTTPRouteConfigsPerPort(serviceIdentity identity.ServiceIdentity) map[int][]*trafficpolicy.EgressHTTPRouteConfig
- func (mc *MeshCatalog) GetEgressTrafficMatches(serviceIdentity identity.ServiceIdentity) ([]*trafficpolicy.TrafficMatch, error)
- func (mc *MeshCatalog) GetInboundMeshClusterConfigs(upstreamServices []service.MeshService) []*trafficpolicy.MeshClusterConfig
- func (mc *MeshCatalog) GetInboundMeshHTTPRouteConfigsPerPort(upstreamIdentity identity.ServiceIdentity, ...) map[int][]*trafficpolicy.InboundTrafficPolicy
- func (mc *MeshCatalog) GetInboundMeshTrafficMatches(upstreamServices []service.MeshService) []*trafficpolicy.TrafficMatch
- func (mc *MeshCatalog) GetIngressHTTPRoutePolicies(meshServices []service.MeshService) [][]*trafficpolicy.InboundTrafficPolicy
- func (mc *MeshCatalog) GetIngressHTTPRoutePoliciesForSvc(svc service.MeshService) []*trafficpolicy.InboundTrafficPolicy
- func (mc *MeshCatalog) GetIngressTrafficMatches(meshServices []service.MeshService) [][]*trafficpolicy.IngressTrafficMatch
- func (mc *MeshCatalog) GetIngressTrafficMatchesForSvc(svc service.MeshService) ([]*trafficpolicy.IngressTrafficMatch, error)
- func (mc *MeshCatalog) GetOutboundMeshClusterConfigs(downstreamIdentity identity.ServiceIdentity) []*trafficpolicy.MeshClusterConfig
- func (mc *MeshCatalog) GetOutboundMeshHTTPRouteConfigsPerPort(downstreamIdentity identity.ServiceIdentity) map[int][]*trafficpolicy.OutboundTrafficPolicy
- func (mc *MeshCatalog) GetOutboundMeshTrafficMatches(downstreamIdentity identity.ServiceIdentity) []*trafficpolicy.TrafficMatch
- func (mc *MeshCatalog) ListAllowedUpstreamEndpointsForService(downstreamIdentity identity.ServiceIdentity, upstreamSvc service.MeshService) []endpoint.Endpoint
- func (mc *MeshCatalog) ListInboundServiceIdentities(upstream identity.ServiceIdentity) []identity.ServiceIdentity
- func (mc *MeshCatalog) ListInboundTrafficTargetsWithRoutes(upstream identity.ServiceIdentity) ([]trafficpolicy.TrafficTargetWithRoutes, error)
- func (mc *MeshCatalog) ListOutboundServiceIdentities(downstream identity.ServiceIdentity) []identity.ServiceIdentity
- func (mc *MeshCatalog) ListOutboundServicesForIdentity(serviceIdentity identity.ServiceIdentity) []service.MeshService
- func (mc *MeshCatalog) ListTrafficSplitsByOptions(options ...smi.TrafficSplitListOption) []*smiSplit.TrafficSplit
- func (mc *MeshCatalog) ListTrafficTargetsByOptions(options ...smi.TrafficTargetListOption) []*smiAccess.TrafficTarget
- type MeshCataloger
Constants ¶
const ( // AllowPartialHostnamesMatch is used to allow a partial/subset match on hostnames in traffic policies AllowPartialHostnamesMatch bool = true // DisallowPartialHostnamesMatch is used to disallow a partial/subset match on hostnames in traffic policies DisallowPartialHostnamesMatch bool = false )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MeshCatalog ¶
MeshCatalog is the struct for the service catalog
func NewMeshCatalog ¶
func NewMeshCatalog(computeInterface compute.Interface, certManager *certificate.Manager, stop <-chan struct{}, msgBroker *messaging.Broker) *MeshCatalog
NewMeshCatalog creates a new service catalog
func (*MeshCatalog) GetEgressClusterConfigs ¶
func (mc *MeshCatalog) GetEgressClusterConfigs(serviceIdentity identity.ServiceIdentity) ([]*trafficpolicy.EgressClusterConfig, error)
GetEgressClusterConfigs returns the cluster configs for the Egress traffic policy associated with the given service identity
func (*MeshCatalog) GetEgressHTTPRouteConfigsPerPort ¶
func (mc *MeshCatalog) GetEgressHTTPRouteConfigsPerPort(serviceIdentity identity.ServiceIdentity) map[int][]*trafficpolicy.EgressHTTPRouteConfig
GetEgressHTTPRouteConfigsPerPort returns the map of Egress http route configs per port for the Egress traffic policy associated with the given service identity
func (*MeshCatalog) GetEgressTrafficMatches ¶
func (mc *MeshCatalog) GetEgressTrafficMatches(serviceIdentity identity.ServiceIdentity) ([]*trafficpolicy.TrafficMatch, error)
GetEgressTrafficMatches returns the traffic matches for the Egress traffic policy associated with the given service identity
func (*MeshCatalog) GetInboundMeshClusterConfigs ¶
func (mc *MeshCatalog) GetInboundMeshClusterConfigs(upstreamServices []service.MeshService) []*trafficpolicy.MeshClusterConfig
GetInboundMeshClusterConfigs returns the cluster configs for the inbound mesh traffic policy for the given upstream services
func (*MeshCatalog) GetInboundMeshHTTPRouteConfigsPerPort ¶
func (mc *MeshCatalog) GetInboundMeshHTTPRouteConfigsPerPort(upstreamIdentity identity.ServiceIdentity, upstreamServices []service.MeshService) map[int][]*trafficpolicy.InboundTrafficPolicy
GetInboundMeshHTTPRouteConfigsPerPort returns a map of the given inbound traffic policy per port for the given upstream identity and services
func (*MeshCatalog) GetInboundMeshTrafficMatches ¶
func (mc *MeshCatalog) GetInboundMeshTrafficMatches(upstreamServices []service.MeshService) []*trafficpolicy.TrafficMatch
GetInboundMeshTrafficMatches returns the traffic matches for the inbound mesh traffic policy for the given upstream services
func (*MeshCatalog) GetIngressHTTPRoutePolicies ¶
func (mc *MeshCatalog) GetIngressHTTPRoutePolicies(meshServices []service.MeshService) [][]*trafficpolicy.InboundTrafficPolicy
GetIngressHTTPRoutePolicies returns all the HTTP route policies for the given MeshService list
func (*MeshCatalog) GetIngressHTTPRoutePoliciesForSvc ¶
func (mc *MeshCatalog) GetIngressHTTPRoutePoliciesForSvc(svc service.MeshService) []*trafficpolicy.InboundTrafficPolicy
GetIngressHTTPRoutePoliciesForSvc returns the inbound traffic policy for the ingressbackend for the given MeshService
func (*MeshCatalog) GetIngressTrafficMatches ¶
func (mc *MeshCatalog) GetIngressTrafficMatches(meshServices []service.MeshService) [][]*trafficpolicy.IngressTrafficMatch
GetIngressTrafficMatches returns all the ingress traffic matches for the given MeshService list
func (*MeshCatalog) GetIngressTrafficMatchesForSvc ¶
func (mc *MeshCatalog) GetIngressTrafficMatchesForSvc(svc service.MeshService) ([]*trafficpolicy.IngressTrafficMatch, error)
GetIngressTrafficMatchesForSvc returns the ingress traffic matches for ingress backend for the given MeshService
func (*MeshCatalog) GetOutboundMeshClusterConfigs ¶
func (mc *MeshCatalog) GetOutboundMeshClusterConfigs(downstreamIdentity identity.ServiceIdentity) []*trafficpolicy.MeshClusterConfig
GetOutboundMeshClusterConfigs returns the cluster configs for the outbound mesh traffic policy for the given downstream identity
func (*MeshCatalog) GetOutboundMeshHTTPRouteConfigsPerPort ¶
func (mc *MeshCatalog) GetOutboundMeshHTTPRouteConfigsPerPort(downstreamIdentity identity.ServiceIdentity) map[int][]*trafficpolicy.OutboundTrafficPolicy
GetOutboundMeshHTTPRouteConfigsPerPort returns the map of outbound traffic policies per port for the given downstream identity
func (*MeshCatalog) GetOutboundMeshTrafficMatches ¶
func (mc *MeshCatalog) GetOutboundMeshTrafficMatches(downstreamIdentity identity.ServiceIdentity) []*trafficpolicy.TrafficMatch
GetOutboundMeshTrafficMatches returns the traffic matches for the outbound mesh traffic policy for the given downstream identity
func (*MeshCatalog) ListAllowedUpstreamEndpointsForService ¶
func (mc *MeshCatalog) ListAllowedUpstreamEndpointsForService(downstreamIdentity identity.ServiceIdentity, upstreamSvc service.MeshService) []endpoint.Endpoint
ListAllowedUpstreamEndpointsForService returns the list of endpoints over which the downstream client identity is allowed access the upstream service
func (*MeshCatalog) ListInboundServiceIdentities ¶
func (mc *MeshCatalog) ListInboundServiceIdentities(upstream identity.ServiceIdentity) []identity.ServiceIdentity
ListInboundServiceIdentities lists the downstream service identities that are allowed to connect to the given service identity Note: ServiceIdentity must be in the format "name.namespace" [https://github.com/kpbaseten/bookstore/issues/3188]
func (*MeshCatalog) ListInboundTrafficTargetsWithRoutes ¶
func (mc *MeshCatalog) ListInboundTrafficTargetsWithRoutes(upstream identity.ServiceIdentity) ([]trafficpolicy.TrafficTargetWithRoutes, error)
ListInboundTrafficTargetsWithRoutes returns a list traffic target objects composed of its routes for the given destination service account Note: ServiceIdentity must be in the format "name.namespace" [https://github.com/kpbaseten/bookstore/issues/3188]
func (*MeshCatalog) ListOutboundServiceIdentities ¶
func (mc *MeshCatalog) ListOutboundServiceIdentities(downstream identity.ServiceIdentity) []identity.ServiceIdentity
ListOutboundServiceIdentities lists the upstream service identities the given service identity are allowed to connect to Note: ServiceIdentity must be in the format "name.namespace" [https://github.com/kpbaseten/bookstore/issues/3188]
func (*MeshCatalog) ListOutboundServicesForIdentity ¶
func (mc *MeshCatalog) ListOutboundServicesForIdentity(serviceIdentity identity.ServiceIdentity) []service.MeshService
ListOutboundServicesForIdentity list the services the given service account is allowed to initiate outbound connections to Note: ServiceIdentity must be in the format "name.namespace" [https://github.com/kpbaseten/bookstore/issues/3188]
func (*MeshCatalog) ListTrafficSplitsByOptions ¶
func (mc *MeshCatalog) ListTrafficSplitsByOptions(options ...smi.TrafficSplitListOption) []*smiSplit.TrafficSplit
ListTrafficSplitsByOptions returns a list of TrafficSplit resources that match the given options
func (*MeshCatalog) ListTrafficTargetsByOptions ¶
func (mc *MeshCatalog) ListTrafficTargetsByOptions(options ...smi.TrafficTargetListOption) []*smiAccess.TrafficTarget
ListTrafficTargetsByOptions returns a list of traffic targets that match the given options.
type MeshCataloger ¶
type MeshCataloger interface { compute.Interface // ListOutboundServicesForIdentity list the services the given service identity is allowed to initiate outbound connections to ListOutboundServicesForIdentity(identity.ServiceIdentity) []service.MeshService // ListInboundServiceIdentities lists the downstream service identities that are allowed to connect to the given service identity ListInboundServiceIdentities(identity.ServiceIdentity) []identity.ServiceIdentity // ListOutboundServiceIdentities lists the upstream service identities the given service identity are allowed to connect to ListOutboundServiceIdentities(identity.ServiceIdentity) []identity.ServiceIdentity // ListAllowedUpstreamEndpointsForService returns the list of endpoints over which the downstream client identity // is allowed access the upstream service ListAllowedUpstreamEndpointsForService(identity.ServiceIdentity, service.MeshService) []endpoint.Endpoint // ListInboundTrafficTargetsWithRoutes returns a list traffic target objects composed of its routes for the given destination service identity ListInboundTrafficTargetsWithRoutes(identity.ServiceIdentity) ([]trafficpolicy.TrafficTargetWithRoutes, error) // GetInboundMeshClusterConfigs returns the cluster configs for the inbound mesh traffic policy for the given upstream services GetInboundMeshClusterConfigs([]service.MeshService) []*trafficpolicy.MeshClusterConfig // GetInboundMeshTrafficMatches returns the traffic matches for the inbound mesh traffic policy for the given upstream services GetInboundMeshTrafficMatches([]service.MeshService) []*trafficpolicy.TrafficMatch // GetInboundMeshHTTPRouteConfigsPerPort returns a map of the given inbound traffic policy per port for the given upstream identity and services GetInboundMeshHTTPRouteConfigsPerPort(identity.ServiceIdentity, []service.MeshService) map[int][]*trafficpolicy.InboundTrafficPolicy // GetOutboundMeshClusterConfigs returns the cluster configs for the outbound mesh traffic policy for the given downstream identity GetOutboundMeshClusterConfigs(identity.ServiceIdentity) []*trafficpolicy.MeshClusterConfig // GetOutboundMeshTrafficMatches returns the traffic matches for the outbound mesh traffic policy for the given downstream identity GetOutboundMeshTrafficMatches(identity.ServiceIdentity) []*trafficpolicy.TrafficMatch // GetOutboundMeshHTTPRouteConfigsPerPort returns a map of the given outbound traffic policy per port for the given downstream identity GetOutboundMeshHTTPRouteConfigsPerPort(identity.ServiceIdentity) map[int][]*trafficpolicy.OutboundTrafficPolicy // GetEgressClusterConfigs returns the cluster configs for the egress traffic policy associated with the given service identity. GetEgressClusterConfigs(identity.ServiceIdentity) ([]*trafficpolicy.EgressClusterConfig, error) // GetEgressTrafficMatches returns the traffic matches for the egress traffic policy associated with the given service identity. GetEgressTrafficMatches(identity.ServiceIdentity) ([]*trafficpolicy.TrafficMatch, error) // GetEgressHTTPRouteConfigsPerPort returns a map of the given egress http route config per port for the egress traffic policy associated with the given service identity. GetEgressHTTPRouteConfigsPerPort(identity.ServiceIdentity) map[int][]*trafficpolicy.EgressHTTPRouteConfig // GetIngressHTTPRoutePolicies returns the HTTP route policies for the ingress traffic policy for all mesh services GetIngressHTTPRoutePolicies([]service.MeshService) [][]*trafficpolicy.InboundTrafficPolicy // GetIngressHTTPRoutePoliciesForSvc returns the HTTP route policies for the ingress traffic policy for the given mesh service GetIngressHTTPRoutePoliciesForSvc(service.MeshService) []*trafficpolicy.InboundTrafficPolicy // GetIngressTrafficMatchesForSvc returns the traffic matches for the ingress traffic policy for the given mesh service GetIngressTrafficMatchesForSvc(service.MeshService) ([]*trafficpolicy.IngressTrafficMatch, error) // GetIngressHTTPRoutePolicies returns the ingress traffic matches for the ingress traffic policy for the given mesh service GetIngressTrafficMatches([]service.MeshService) [][]*trafficpolicy.IngressTrafficMatch }
MeshCataloger is the mechanism by which the Service Mesh controller discovers all Envoy proxies connected to the catalog.