clustermesh

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: Apache-2.0 Imports: 23 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterMesh

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

ClusterMesh is a cache of multiple remote clusters

func NewClusterMesh

func NewClusterMesh(c Configuration) (*ClusterMesh, error)

NewClusterMesh creates a new remote cluster cache based on the provided configuration

func (*ClusterMesh) Close added in v1.5.0

func (cm *ClusterMesh) Close()

Close stops watching for remote cluster configuration files to appear and will close all connections to remote clusters

func (*ClusterMesh) ClustersSynced added in v1.7.0

func (cm *ClusterMesh) ClustersSynced(ctx context.Context) error

ClustersSynced returns after all clusters were synchronized with the bpf datapath.

func (*ClusterMesh) NumReadyClusters

func (cm *ClusterMesh) NumReadyClusters() int

NumReadyClusters returns the number of remote clusters to which a connection has been established

func (*ClusterMesh) Status

func (cm *ClusterMesh) Status() (status *models.ClusterMeshStatus)

Status returns the status of the ClusterMesh subsystem

type Configuration

type Configuration struct {
	// Name is the name of the remote cluster cache. This is for logging
	// purposes only
	Name string

	// ConfigDirectory is the path to the directory that will be watched for etcd
	// configuration files to appear
	ConfigDirectory string

	// NodeKeyCreator is the function used to create node instances as
	// nodes are being discovered in remote clusters
	NodeKeyCreator store.KeyCreator

	// ServiceMerger is the interface responsible to merge service and
	// endpoints into an existing cache
	ServiceMerger ServiceMerger

	// NodeManager is the node manager to manage all discovered remote
	// nodes
	NodeManager *nodemanager.Manager

	// RemoteIdentityWatcher provides identities that have been allocated on a
	// remote cluster.
	RemoteIdentityWatcher RemoteIdentityWatcher
	// contains filtered or unexported fields
}

Configuration is the configuration that must be provided to NewClusterMesh()

func (*Configuration) NodeObserver

func (c *Configuration) NodeObserver() store.Observer

NodeObserver returns the node store observer of the configuration

type RemoteIdentityWatcher

type RemoteIdentityWatcher interface {
	// WatchRemoteIdentities starts watching for identities in another kvstore and
	// syncs all identities to the local identity cache.
	WatchRemoteIdentities(backend kvstore.BackendOperations) (*allocator.RemoteCache, error)

	// Close stops the watcher.
	Close()
}

RemoteIdentityWatcher is any type which provides identities that have been allocated on a remote cluster.

type ServiceMerger

type ServiceMerger interface {
	MergeExternalServiceUpdate(service *serviceStore.ClusterService, swg *lock.StoppableWaitGroup)
	MergeExternalServiceDelete(service *serviceStore.ClusterService, swg *lock.StoppableWaitGroup)
}

ServiceMerger is the interface to be implemented by the owner of local services. The functions have to merge service updates and deletions with local services to provide a shared view.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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