import "istio.io/istio/pilot/pkg/serviceregistry/aggregate"
type Controller struct {
// contains filtered or unexported fields
}
Controller aggregates data across different registries and monitors for changes
func NewController(opt Options) *Controller
NewController creates a new Aggregate controller
func (c *Controller) AddRegistry(registry serviceregistry.Instance)
AddRegistry adds registries into the aggregated controller
AppendServiceHandler implements a service catalog operation
func (c *Controller) AppendWorkloadHandler(f func(*model.WorkloadInstance, model.Event))
func (c *Controller) DeleteRegistry(clusterID string, providerID serviceregistry.ProviderID)
DeleteRegistry deletes specified registry from the aggregated controller
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 (c *Controller) GetProxyServiceInstances(node *model.Proxy) []*model.ServiceInstance
GetProxyServiceInstances lists service instances co-located with a given proxy
func (c *Controller) GetProxyWorkloadLabels(proxy *model.Proxy) labels.Collection
func (c *Controller) GetRegistries() []serviceregistry.Instance
GetRegistries returns a copy of all registries
func (c *Controller) GetRegistryIndex(clusterID string, provider serviceregistry.ProviderID) (int, bool)
GetRegistryIndex returns the index of a registry
GetService retrieves a service by hostname if exists
func (c *Controller) HasSynced() bool
HasSynced returns true when all registries have synced
func (c *Controller) InstancesByPort(svc *model.Service, port int, labels labels.Collection) []*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 (c *Controller) NetworkGateways() map[string][]*model.Gateway
NetworkGateways merges the service-based cross-network gateways from each registry.
func (c *Controller) Run(stop <-chan struct{})
Run starts all the controllers
func (c *Controller) Running() bool
Running returns true after Run has been called. If already running, registries passed to AddRegistry should be started outside of this aggregate controller.
func (c *Controller) Services() ([]*model.Service, error)
Services lists services from all platforms
Package aggregate imports 10 packages (graph) and is imported by 8 packages. Updated 2021-01-15. Refresh now. Tools for package owners.