Documentation ¶
Index ¶
- type Controller
- func (c *Controller) AddRegistry(registry serviceregistry.Instance)
- func (c *Controller) AddRegistryAndRun(registry serviceregistry.Instance, stop <-chan struct{})
- func (c *Controller) AppendServiceHandler(f func(*model.Service, model.Event))
- func (c *Controller) AppendServiceHandlerForCluster(id cluster.ID, f func(*model.Service, model.Event))
- func (c *Controller) AppendWorkloadHandler(f func(*model.WorkloadInstance, model.Event))
- func (c *Controller) AppendWorkloadHandlerForCluster(id cluster.ID, f func(*model.WorkloadInstance, model.Event))
- func (c *Controller) DeleteRegistry(clusterID cluster.ID, providerID provider.ID)
- func (c *Controller) GetIstioServiceAccounts(svc *model.Service, ports []int) []string
- func (c *Controller) GetProxyServiceInstances(node *model.Proxy) []*model.ServiceInstance
- func (c *Controller) GetProxyWorkloadLabels(proxy *model.Proxy) labels.Instance
- func (c *Controller) GetRegistries() []serviceregistry.Instance
- func (c *Controller) GetService(hostname host.Name) *model.Service
- func (c *Controller) HasSynced() bool
- func (c *Controller) InstancesByPort(svc *model.Service, port int, labels labels.Instance) []*model.ServiceInstance
- func (c *Controller) MCSServices() []model.MCSServiceInfo
- func (c *Controller) NetworkGateways() []model.NetworkGateway
- func (c *Controller) Run(stop <-chan struct{})
- func (c *Controller) Services() []*model.Service
- func (c *Controller) UnRegisterHandlersForCluster(id cluster.ID)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { model.NetworkGatewaysHandler // contains filtered or unexported fields }
Controller aggregates data across different registries and monitors for changes
func NewController ¶
func NewController(opt Options) *Controller
NewController creates a new Aggregate controller
func (*Controller) AddRegistry ¶
func (c *Controller) AddRegistry(registry serviceregistry.Instance)
AddRegistry adds registries into the aggregated controller. If the aggregated controller is already Running, the given registry will never be started.
func (*Controller) AddRegistryAndRun ¶
func (c *Controller) AddRegistryAndRun(registry serviceregistry.Instance, stop <-chan struct{})
AddRegistryAndRun adds registries into the aggregated controller and makes sure it is Run. If the aggregated controller is running, the given registry is Run immediately. Otherwise, the given registry is Run when the aggregate controller is Run, using the given stop.
func (*Controller) AppendServiceHandler ¶
func (c *Controller) AppendServiceHandler(f func(*model.Service, model.Event))
func (*Controller) AppendServiceHandlerForCluster ¶
func (*Controller) AppendWorkloadHandler ¶
func (c *Controller) AppendWorkloadHandler(f func(*model.WorkloadInstance, model.Event))
func (*Controller) AppendWorkloadHandlerForCluster ¶
func (c *Controller) AppendWorkloadHandlerForCluster(id cluster.ID, f func(*model.WorkloadInstance, model.Event))
func (*Controller) DeleteRegistry ¶
func (c *Controller) DeleteRegistry(clusterID cluster.ID, providerID provider.ID)
DeleteRegistry deletes specified registry from the aggregated controller
func (*Controller) GetIstioServiceAccounts ¶
func (c *Controller) GetIstioServiceAccounts(svc *model.Service, ports []int) []string
GetIstioServiceAccounts implements model.ServiceAccounts operation. The returned list contains all SPIFFE based identities that backs the service. This method also expand the results from different registries based on the mesh config trust domain aliases. To retain such trust domain expansion behavior, the xDS server implementation should wrap any (even if single) service registry by this aggreated one. For example,
- { "spiffe://cluster.local/bar@iam.gserviceaccount.com"}; when annotation is used on corresponding workloads.
- { "spiffe://cluster.local/ns/default/sa/foo" }; normal kubernetes cases
- { "spiffe://cluster.local/ns/default/sa/foo", "spiffe://trust-domain-alias/ns/default/sa/foo" }; if the trust domain alias is configured.
func (*Controller) GetProxyServiceInstances ¶
func (c *Controller) GetProxyServiceInstances(node *model.Proxy) []*model.ServiceInstance
GetProxyServiceInstances lists service instances co-located with a given proxy
func (*Controller) GetProxyWorkloadLabels ¶
func (c *Controller) GetProxyWorkloadLabels(proxy *model.Proxy) labels.Instance
func (*Controller) GetRegistries ¶
func (c *Controller) GetRegistries() []serviceregistry.Instance
GetRegistries returns a copy of all registries
func (*Controller) GetService ¶
func (c *Controller) GetService(hostname host.Name) *model.Service
GetService retrieves a service by hostname if exists
func (*Controller) HasSynced ¶
func (c *Controller) HasSynced() bool
HasSynced returns true when all registries have synced
func (*Controller) InstancesByPort ¶
func (c *Controller) InstancesByPort(svc *model.Service, port int, labels labels.Instance) []*model.ServiceInstance
InstancesByPort retrieves instances for a service on a given port that match any of the supplied labels. All instances match an empty label list.
func (*Controller) MCSServices ¶
func (c *Controller) MCSServices() []model.MCSServiceInfo
func (*Controller) NetworkGateways ¶
func (c *Controller) NetworkGateways() []model.NetworkGateway
NetworkGateways merges the service-based cross-network gateways from each registry.
func (*Controller) Run ¶
func (c *Controller) Run(stop <-chan struct{})
Run starts all the controllers
func (*Controller) Services ¶
func (c *Controller) Services() []*model.Service
Services lists services from all platforms
func (*Controller) UnRegisterHandlersForCluster ¶
func (c *Controller) UnRegisterHandlersForCluster(id cluster.ID)