catalog

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package catalog is a generated GoMock package.

Index

Constants

View Source
const (
	//HTTPTraffic specifies HTTP Traffic Policy
	HTTPTraffic = "HTTPRouteGroup"
)

Variables

This section is empty.

Functions

func GetPodFromCertificate

func GetPodFromCertificate(cn certificate.CommonName, kubecontroller k8s.Controller) (*v1.Pod, error)

GetPodFromCertificate returns the Kubernetes Pod object for a given certificate.

func NewCertCommonNameWithProxyID

func NewCertCommonNameWithProxyID(proxyUUID uuid.UUID, serviceAccount, namespace string) certificate.CommonName

NewCertCommonNameWithProxyID returns a newly generated CommonName for a certificate of the form: <ProxyUUID>.<serviceAccount>.<namespace>

Types

type MeshCatalog

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

MeshCatalog is the struct for the service catalog

func NewFakeMeshCatalog

func NewFakeMeshCatalog(kubeClient kubernetes.Interface) *MeshCatalog

NewFakeMeshCatalog creates a new struct implementing catalog.MeshCataloger interface used for testing.

func NewMeshCatalog

func NewMeshCatalog(kubeController k8s.Controller, kubeClient kubernetes.Interface, meshSpec smi.MeshSpec, certManager certificate.Manager, ingressMonitor ingress.Monitor, stop <-chan struct{}, cfg configurator.Configurator, endpointsProviders ...endpoint.Provider) *MeshCatalog

NewMeshCatalog creates a new service catalog

func (*MeshCatalog) ExpectProxy

func (mc *MeshCatalog) ExpectProxy(cn certificate.CommonName)

ExpectProxy catalogs the fact that a certificate was issued for an Envoy proxy and this is expected to connect to XDS.

func (*MeshCatalog) GetCertificateForService

func (mc *MeshCatalog) GetCertificateForService(meshService service.MeshService) (certificate.Certificater, error)

GetCertificateForService returns the certificate the given proxy uses for mTLS to the XDS server.

func (*MeshCatalog) GetIngressRoutesPerHost

func (mc *MeshCatalog) GetIngressRoutesPerHost(service service.MeshService) (map[string][]trafficpolicy.HTTPRoute, error)

GetIngressRoutesPerHost returns routes per host as defined in observed ingress k8s resources.

func (*MeshCatalog) GetResolvableHostnamesForUpstreamService added in v0.5.0

func (mc *MeshCatalog) GetResolvableHostnamesForUpstreamService(downstream, upstream service.MeshService) ([]string, error)

GetResolvableHostnamesForUpstreamService returns the hostnames over which an upstream service is accessible from a downstream service The hostname is the FQDN for the service, and can include ports as well. Ex. bookstore.default, bookstore.default:80, bookstore.default.svc, bookstore.default.svc:80 etc.

func (*MeshCatalog) GetResolvableServiceEndpoints added in v0.4.0

func (mc *MeshCatalog) GetResolvableServiceEndpoints(svc service.MeshService) ([]endpoint.Endpoint, error)

GetResolvableServiceEndpoints returns the resolvable set of endpoint over which a service is accessible using its FQDN

func (*MeshCatalog) GetSMISpec

func (mc *MeshCatalog) GetSMISpec() smi.MeshSpec

GetSMISpec returns a MeshCatalog's SMI Spec

func (*MeshCatalog) GetServicesForServiceAccount added in v0.4.0

func (mc *MeshCatalog) GetServicesForServiceAccount(sa service.K8sServiceAccount) ([]service.MeshService, error)

GetServicesForServiceAccount returns a list of services corresponding to a service account

func (*MeshCatalog) GetServicesFromEnvoyCertificate added in v0.4.0

func (mc *MeshCatalog) GetServicesFromEnvoyCertificate(cn certificate.CommonName) ([]service.MeshService, error)

GetServicesFromEnvoyCertificate returns a list of services the given Envoy is a member of based on the certificate provided, which is a cert issued to an Envoy for XDS communication (not Envoy-to-Envoy).

func (*MeshCatalog) GetWeightedClusterForService

func (mc *MeshCatalog) GetWeightedClusterForService(svc service.MeshService) (service.WeightedCluster, error)

GetWeightedClusterForService returns the weighted cluster for a given service

func (*MeshCatalog) ListAllowedInboundServices

func (mc *MeshCatalog) ListAllowedInboundServices(destinationService service.MeshService) ([]service.MeshService, error)

ListAllowedInboundServices lists the inbound services allowed to connect to the given service.

func (*MeshCatalog) ListAllowedOutboundServices

func (mc *MeshCatalog) ListAllowedOutboundServices(sourceService service.MeshService) ([]service.MeshService, error)

ListAllowedOutboundServices lists the services the given service is allowed outbound connections to.

func (*MeshCatalog) ListConnectedProxies

func (mc *MeshCatalog) ListConnectedProxies() map[certificate.CommonName]*envoy.Proxy

ListConnectedProxies lists the Envoy proxies already connected and the time they first connected.

func (*MeshCatalog) ListDisconnectedProxies

func (mc *MeshCatalog) ListDisconnectedProxies() map[certificate.CommonName]time.Time

ListDisconnectedProxies lists the Envoy proxies disconnected and the time last seen.

func (*MeshCatalog) ListEndpointsForService

func (mc *MeshCatalog) ListEndpointsForService(svc service.MeshService) ([]endpoint.Endpoint, error)

ListEndpointsForService returns the list of provider endpoints corresponding to a service

func (*MeshCatalog) ListExpectedProxies

func (mc *MeshCatalog) ListExpectedProxies() map[certificate.CommonName]time.Time

ListExpectedProxies lists the Envoy proxies yet to connect and the time their XDS certificate was issued.

func (*MeshCatalog) ListMonitoredNamespaces added in v0.1.0

func (mc *MeshCatalog) ListMonitoredNamespaces() []string

ListMonitoredNamespaces returns all namespaces that the mesh is monitoring.

func (*MeshCatalog) ListSMIPolicies

ListSMIPolicies returns all policies OSM is aware of.

func (*MeshCatalog) ListTrafficPolicies

func (mc *MeshCatalog) ListTrafficPolicies(service service.MeshService) ([]trafficpolicy.TrafficTarget, error)

ListTrafficPolicies returns all the traffic policies for a given service that Envoy proxy should be aware of.

func (*MeshCatalog) RegisterProxy

func (mc *MeshCatalog) RegisterProxy(p *envoy.Proxy)

RegisterProxy implements MeshCatalog and registers a newly connected proxy.

func (*MeshCatalog) UnregisterProxy

func (mc *MeshCatalog) UnregisterProxy(p *envoy.Proxy)

UnregisterProxy unregisters the given proxy from the catalog.

type MeshCataloger

type MeshCataloger interface {
	// GetSMISpec returns the SMI spec
	GetSMISpec() smi.MeshSpec

	// ListTrafficPolicies returns all the traffic policies for a given service that Envoy proxy should be aware of.
	ListTrafficPolicies(service.MeshService) ([]trafficpolicy.TrafficTarget, error)

	// ListAllowedInboundServices lists the inbound services allowed to connect to the given service.
	ListAllowedInboundServices(service.MeshService) ([]service.MeshService, error)

	// ListAllowedOutboundServices lists the services the given service is allowed outbound connections to.
	ListAllowedOutboundServices(service.MeshService) ([]service.MeshService, error)

	// ListSMIPolicies lists SMI policies.
	ListSMIPolicies() ([]*split.TrafficSplit, []service.WeightedService, []service.K8sServiceAccount, []*spec.HTTPRouteGroup, []*target.TrafficTarget)

	// ListEndpointsForService returns the list of individual instance endpoint backing a service
	ListEndpointsForService(service.MeshService) ([]endpoint.Endpoint, error)

	// GetResolvableServiceEndpoints returns the resolvable set of endpoint over which a service is accessible using its FQDN.
	// These are the endpoint destinations we'd expect client applications sends the traffic towards to, when attemtpting to
	// reach a specific service.
	// If no LB/virtual IPs are assigned to the service, GetResolvableServiceEndpoints will return ListEndpointsForService
	GetResolvableServiceEndpoints(service.MeshService) ([]endpoint.Endpoint, error)

	// GetCertificateForService returns the SSL Certificate for the given service.
	// This certificate will be used for service-to-service mTLS.
	GetCertificateForService(service.MeshService) (certificate.Certificater, error)

	// ExpectProxy catalogs the fact that a certificate was issued for an Envoy proxy and this is expected to connect to XDS.
	ExpectProxy(certificate.CommonName)

	// GetServicesFromEnvoyCertificate returns a list of services the given Envoy is a member of based on the certificate provided, which is a cert issued to an Envoy for XDS communication (not Envoy-to-Envoy).
	GetServicesFromEnvoyCertificate(certificate.CommonName) ([]service.MeshService, error)

	// RegisterProxy registers a newly connected proxy with the service mesh catalog.
	RegisterProxy(*envoy.Proxy)

	// UnregisterProxy unregisters an existing proxy from the service mesh catalog
	UnregisterProxy(*envoy.Proxy)

	// GetServicesForServiceAccount returns a list of services corresponding to a service account
	GetServicesForServiceAccount(service.K8sServiceAccount) ([]service.MeshService, error)

	// GetResolvableHostnamesForUpstreamService returns the hostnames over which an upstream service is accessible from a downstream service
	GetResolvableHostnamesForUpstreamService(downstream, upstream service.MeshService) ([]string, error)

	//GetWeightedClusterForService returns the weighted cluster for a service
	GetWeightedClusterForService(service service.MeshService) (service.WeightedCluster, error)

	// GetIngressRoutesPerHost returns the HTTP routes per host associated with an ingress service
	GetIngressRoutesPerHost(service.MeshService) (map[string][]trafficpolicy.HTTPRoute, error)

	// ListMonitoredNamespaces lists namespaces monitored by the control plane
	ListMonitoredNamespaces() []string
}

MeshCataloger is the mechanism by which the Service Mesh controller discovers all Envoy proxies connected to the catalog.

type MockMeshCataloger added in v0.4.1

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

MockMeshCataloger is a mock of MeshCataloger interface

func NewMockMeshCataloger added in v0.4.1

func NewMockMeshCataloger(ctrl *gomock.Controller) *MockMeshCataloger

NewMockMeshCataloger creates a new mock instance

func (*MockMeshCataloger) EXPECT added in v0.4.1

EXPECT returns an object that allows the caller to indicate expected use

func (*MockMeshCataloger) ExpectProxy added in v0.4.1

func (m *MockMeshCataloger) ExpectProxy(arg0 certificate.CommonName)

ExpectProxy mocks base method

func (*MockMeshCataloger) GetCertificateForService added in v0.4.1

func (m *MockMeshCataloger) GetCertificateForService(arg0 service.MeshService) (certificate.Certificater, error)

GetCertificateForService mocks base method

func (*MockMeshCataloger) GetIngressRoutesPerHost added in v0.4.1

func (m *MockMeshCataloger) GetIngressRoutesPerHost(arg0 service.MeshService) (map[string][]trafficpolicy.HTTPRoute, error)

GetIngressRoutesPerHost mocks base method

func (*MockMeshCataloger) GetResolvableHostnamesForUpstreamService added in v0.5.0

func (m *MockMeshCataloger) GetResolvableHostnamesForUpstreamService(arg0, arg1 service.MeshService) ([]string, error)

GetResolvableHostnamesForUpstreamService mocks base method

func (*MockMeshCataloger) GetResolvableServiceEndpoints added in v0.4.1

func (m *MockMeshCataloger) GetResolvableServiceEndpoints(arg0 service.MeshService) ([]endpoint.Endpoint, error)

GetResolvableServiceEndpoints mocks base method

func (*MockMeshCataloger) GetSMISpec added in v0.4.1

func (m *MockMeshCataloger) GetSMISpec() smi.MeshSpec

GetSMISpec mocks base method

func (*MockMeshCataloger) GetServicesForServiceAccount added in v0.4.1

func (m *MockMeshCataloger) GetServicesForServiceAccount(arg0 service.K8sServiceAccount) ([]service.MeshService, error)

GetServicesForServiceAccount mocks base method

func (*MockMeshCataloger) GetServicesFromEnvoyCertificate added in v0.4.1

func (m *MockMeshCataloger) GetServicesFromEnvoyCertificate(arg0 certificate.CommonName) ([]service.MeshService, error)

GetServicesFromEnvoyCertificate mocks base method

func (*MockMeshCataloger) GetWeightedClusterForService added in v0.4.1

func (m *MockMeshCataloger) GetWeightedClusterForService(arg0 service.MeshService) (service.WeightedCluster, error)

GetWeightedClusterForService mocks base method

func (*MockMeshCataloger) ListAllowedInboundServices added in v0.4.1

func (m *MockMeshCataloger) ListAllowedInboundServices(arg0 service.MeshService) ([]service.MeshService, error)

ListAllowedInboundServices mocks base method

func (*MockMeshCataloger) ListAllowedOutboundServices added in v0.4.1

func (m *MockMeshCataloger) ListAllowedOutboundServices(arg0 service.MeshService) ([]service.MeshService, error)

ListAllowedOutboundServices mocks base method

func (*MockMeshCataloger) ListEndpointsForService added in v0.4.1

func (m *MockMeshCataloger) ListEndpointsForService(arg0 service.MeshService) ([]endpoint.Endpoint, error)

ListEndpointsForService mocks base method

func (*MockMeshCataloger) ListMonitoredNamespaces added in v0.4.1

func (m *MockMeshCataloger) ListMonitoredNamespaces() []string

ListMonitoredNamespaces mocks base method

func (*MockMeshCataloger) ListSMIPolicies added in v0.4.1

ListSMIPolicies mocks base method

func (*MockMeshCataloger) ListTrafficPolicies added in v0.4.1

func (m *MockMeshCataloger) ListTrafficPolicies(arg0 service.MeshService) ([]trafficpolicy.TrafficTarget, error)

ListTrafficPolicies mocks base method

func (*MockMeshCataloger) RegisterProxy added in v0.4.1

func (m *MockMeshCataloger) RegisterProxy(arg0 *envoy.Proxy)

RegisterProxy mocks base method

func (*MockMeshCataloger) UnregisterProxy added in v0.4.1

func (m *MockMeshCataloger) UnregisterProxy(arg0 *envoy.Proxy)

UnregisterProxy mocks base method

type MockMeshCatalogerMockRecorder added in v0.4.1

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

MockMeshCatalogerMockRecorder is the mock recorder for MockMeshCataloger

func (*MockMeshCatalogerMockRecorder) ExpectProxy added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) ExpectProxy(arg0 interface{}) *gomock.Call

ExpectProxy indicates an expected call of ExpectProxy

func (*MockMeshCatalogerMockRecorder) GetCertificateForService added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) GetCertificateForService(arg0 interface{}) *gomock.Call

GetCertificateForService indicates an expected call of GetCertificateForService

func (*MockMeshCatalogerMockRecorder) GetIngressRoutesPerHost added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) GetIngressRoutesPerHost(arg0 interface{}) *gomock.Call

GetIngressRoutesPerHost indicates an expected call of GetIngressRoutesPerHost

func (*MockMeshCatalogerMockRecorder) GetResolvableHostnamesForUpstreamService added in v0.5.0

func (mr *MockMeshCatalogerMockRecorder) GetResolvableHostnamesForUpstreamService(arg0, arg1 interface{}) *gomock.Call

GetResolvableHostnamesForUpstreamService indicates an expected call of GetResolvableHostnamesForUpstreamService

func (*MockMeshCatalogerMockRecorder) GetResolvableServiceEndpoints added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) GetResolvableServiceEndpoints(arg0 interface{}) *gomock.Call

GetResolvableServiceEndpoints indicates an expected call of GetResolvableServiceEndpoints

func (*MockMeshCatalogerMockRecorder) GetSMISpec added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) GetSMISpec() *gomock.Call

GetSMISpec indicates an expected call of GetSMISpec

func (*MockMeshCatalogerMockRecorder) GetServicesForServiceAccount added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) GetServicesForServiceAccount(arg0 interface{}) *gomock.Call

GetServicesForServiceAccount indicates an expected call of GetServicesForServiceAccount

func (*MockMeshCatalogerMockRecorder) GetServicesFromEnvoyCertificate added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) GetServicesFromEnvoyCertificate(arg0 interface{}) *gomock.Call

GetServicesFromEnvoyCertificate indicates an expected call of GetServicesFromEnvoyCertificate

func (*MockMeshCatalogerMockRecorder) GetWeightedClusterForService added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) GetWeightedClusterForService(arg0 interface{}) *gomock.Call

GetWeightedClusterForService indicates an expected call of GetWeightedClusterForService

func (*MockMeshCatalogerMockRecorder) ListAllowedInboundServices added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) ListAllowedInboundServices(arg0 interface{}) *gomock.Call

ListAllowedInboundServices indicates an expected call of ListAllowedInboundServices

func (*MockMeshCatalogerMockRecorder) ListAllowedOutboundServices added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) ListAllowedOutboundServices(arg0 interface{}) *gomock.Call

ListAllowedOutboundServices indicates an expected call of ListAllowedOutboundServices

func (*MockMeshCatalogerMockRecorder) ListEndpointsForService added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) ListEndpointsForService(arg0 interface{}) *gomock.Call

ListEndpointsForService indicates an expected call of ListEndpointsForService

func (*MockMeshCatalogerMockRecorder) ListMonitoredNamespaces added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) ListMonitoredNamespaces() *gomock.Call

ListMonitoredNamespaces indicates an expected call of ListMonitoredNamespaces

func (*MockMeshCatalogerMockRecorder) ListSMIPolicies added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) ListSMIPolicies() *gomock.Call

ListSMIPolicies indicates an expected call of ListSMIPolicies

func (*MockMeshCatalogerMockRecorder) ListTrafficPolicies added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) ListTrafficPolicies(arg0 interface{}) *gomock.Call

ListTrafficPolicies indicates an expected call of ListTrafficPolicies

func (*MockMeshCatalogerMockRecorder) RegisterProxy added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) RegisterProxy(arg0 interface{}) *gomock.Call

RegisterProxy indicates an expected call of RegisterProxy

func (*MockMeshCatalogerMockRecorder) UnregisterProxy added in v0.4.1

func (mr *MockMeshCatalogerMockRecorder) UnregisterProxy(arg0 interface{}) *gomock.Call

UnregisterProxy indicates an expected call of UnregisterProxy

Jump to

Keyboard shortcuts

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