Documentation ¶
Index ¶
- Constants
- func GetPodFromCertificate(cn certificate.CommonName, kubeClient kubernetes.Interface) (*v1.Pod, error)
- func NewCertCommonNameWithProxyID(proxyUUID, serviceAccount, namespace string) certificate.CommonName
- type MeshCatalog
- func (mc *MeshCatalog) ExpectProxy(cn certificate.CommonName)
- func (mc *MeshCatalog) GetCertificateForService(meshService service.MeshService) (certificate.Certificater, error)
- func (mc *MeshCatalog) GetHostnamesForService(meshService service.MeshService) (string, error)
- func (mc *MeshCatalog) GetIngressRoutesPerHost(service service.MeshService) (map[string][]trafficpolicy.Route, error)
- func (mc *MeshCatalog) GetSMISpec() smi.MeshSpec
- func (mc *MeshCatalog) GetServiceForServiceAccount(sa service.K8sServiceAccount) (service.MeshService, error)
- func (mc *MeshCatalog) GetServiceFromEnvoyCertificate(cn certificate.CommonName) (*service.MeshService, error)
- func (mc *MeshCatalog) GetWeightedClusterForService(svc service.MeshService) (service.WeightedCluster, error)
- func (mc *MeshCatalog) ListAllowedInboundServices(destinationService service.MeshService) ([]service.MeshService, error)
- func (mc *MeshCatalog) ListAllowedOutboundServices(sourceService service.MeshService) ([]service.MeshService, error)
- func (mc *MeshCatalog) ListConnectedProxies() map[certificate.CommonName]*envoy.Proxy
- func (mc *MeshCatalog) ListDisconnectedProxies() map[certificate.CommonName]time.Time
- func (mc *MeshCatalog) ListEndpointsForService(svc service.MeshService) ([]endpoint.Endpoint, error)
- func (mc *MeshCatalog) ListExpectedProxies() map[certificate.CommonName]time.Time
- func (mc *MeshCatalog) ListMonitoredNamespaces() []string
- func (mc *MeshCatalog) ListSMIPolicies() ([]*split.TrafficSplit, []service.WeightedService, []service.K8sServiceAccount, ...)
- func (mc *MeshCatalog) ListTrafficPolicies(service service.MeshService) ([]trafficpolicy.TrafficTarget, error)
- func (mc *MeshCatalog) RegisterProxy(p *envoy.Proxy)
- func (mc *MeshCatalog) UnregisterProxy(p *envoy.Proxy)
- type MeshCataloger
Constants ¶
const ( //HTTPTraffic specifies HTTP Traffic Policy HTTPTraffic = "HTTPRouteGroup" //HostHeaderKey specifies the host header key HostHeaderKey = "host" )
Variables ¶
This section is empty.
Functions ¶
func GetPodFromCertificate ¶
func GetPodFromCertificate(cn certificate.CommonName, kubeClient kubernetes.Interface) (*v1.Pod, error)
GetPodFromCertificate returns the Kubernetes Pod object for a given certificate.
func NewCertCommonNameWithProxyID ¶
func NewCertCommonNameWithProxyID(proxyUUID, serviceAccount, namespace string) certificate.CommonName
NewCertCommonNameWithProxyID returns a newly generated CommonName for a certificate of the form: <ProxyID>.<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(namespaceController namespace.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) GetHostnamesForService ¶ added in v0.1.0
func (mc *MeshCatalog) GetHostnamesForService(meshService service.MeshService) (string, error)
GetHostnamesForService returns the hostnames for a service
func (*MeshCatalog) GetIngressRoutesPerHost ¶
func (mc *MeshCatalog) GetIngressRoutesPerHost(service service.MeshService) (map[string][]trafficpolicy.Route, error)
GetIngressRoutesPerHost returns routes per host as defined in observed ingress k8s resources.
func (*MeshCatalog) GetSMISpec ¶
func (mc *MeshCatalog) GetSMISpec() smi.MeshSpec
GetSMISpec returns a MeshCatalog's SMI Spec
func (*MeshCatalog) GetServiceForServiceAccount ¶
func (mc *MeshCatalog) GetServiceForServiceAccount(sa service.K8sServiceAccount) (service.MeshService, error)
GetServiceForServiceAccount returns a service corresponding to a service account
func (*MeshCatalog) GetServiceFromEnvoyCertificate ¶
func (mc *MeshCatalog) GetServiceFromEnvoyCertificate(cn certificate.CommonName) (*service.MeshService, error)
GetServiceFromEnvoyCertificate returns the single service 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 ¶
func (mc *MeshCatalog) ListSMIPolicies() ([]*split.TrafficSplit, []service.WeightedService, []service.K8sServiceAccount, []*spec.HTTPRouteGroup, []*target.TrafficTarget, []*corev1.Service)
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, []*corev1.Service) // ListEndpointsForService returns the list of provider endpoints corresponding to a service ListEndpointsForService(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) // GetServiceFromEnvoyCertificate returns the single service 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). GetServiceFromEnvoyCertificate(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) // GetServiceForServiceAccount returns the service corresponding to a service account GetServiceForServiceAccount(service.K8sServiceAccount) (service.MeshService, error) // GetHostnamesForService returns the hostnames for a service // TODO(ref: PR #1316): return a list of strings GetHostnamesForService(service service.MeshService) (string, error) //GetWeightedClusterForService returns the weighted cluster for a service GetWeightedClusterForService(service service.MeshService) (service.WeightedCluster, error) // GetIngressRoutesPerHost returns the routes per host associated with an ingress service GetIngressRoutesPerHost(service.MeshService) (map[string][]trafficpolicy.Route, 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.