Documentation ¶
Index ¶
- Variables
- func StartMultiClusterSync(ctx context.Context)
- type FuzzyCluster
- type InternalCluster
- type MultiClustersManager
- type MultiClustersMgr
- func (m *MultiClustersMgr) Add(cluster string, c *InternalCluster) error
- func (m *MultiClustersMgr) Del(cluster string) error
- func (m *MultiClustersMgr) FuzzyCopy() map[string]*FuzzyCluster
- func (m *MultiClustersMgr) Get(cluster string) (*InternalCluster, error)
- func (m *MultiClustersMgr) GetClient(cluster string) (kubernetes.Client, error)
- func (m *MultiClustersMgr) ScoutFor(ctx context.Context, cluster string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var MultiClusterMgr = newMultiClusterMgr()
MultiClusterMgr instance implement interface, init pivot cluster at first.
Functions ¶
func StartMultiClusterSync ¶
StartMultiClusterSync as a backend to sync cluster info to memory. Closed when as a leader.
Types ¶
type FuzzyCluster ¶
type FuzzyCluster struct { Name string Config *rest.Config Client kubernetes.Client }
FuzzyCluster be exported for test
type InternalCluster ¶
type InternalCluster struct { Client kubernetes.Client Scout *scout.Scout // Config bind to a real cluster Config *rest.Config // close channel when delete cluster, goroutine // of informer and scout will exit gracefully. StopCh chan struct{} }
InternalCluster represent a cluster runtime contains client and internal warden.
type MultiClustersManager ¶
type MultiClustersManager interface { // Add runtime cache in memory Add(cluster string, internalCluster *InternalCluster) error Get(cluster string) (*InternalCluster, error) Del(cluster string) error // FuzzyCopy return fuzzy cluster of raw FuzzyCopy() map[string]*FuzzyCluster // ScoutFor scout heartbeat for warden ScoutFor(ctx context.Context, cluster string) error // GetClient get client for cluster GetClient(cluster string) (kubernetes.Client, error) }
MultiClustersManager access to internal cluster
type MultiClustersMgr ¶
type MultiClustersMgr struct { sync.RWMutex Clusters map[string]*InternalCluster }
MultiClustersMgr a memory cache for runtime cluster.
func (*MultiClustersMgr) Add ¶
func (m *MultiClustersMgr) Add(cluster string, c *InternalCluster) error
func (*MultiClustersMgr) Del ¶
func (m *MultiClustersMgr) Del(cluster string) error
func (*MultiClustersMgr) FuzzyCopy ¶
func (m *MultiClustersMgr) FuzzyCopy() map[string]*FuzzyCluster
func (*MultiClustersMgr) Get ¶
func (m *MultiClustersMgr) Get(cluster string) (*InternalCluster, error)
func (*MultiClustersMgr) GetClient ¶
func (m *MultiClustersMgr) GetClient(cluster string) (kubernetes.Client, error)
Click to show internal directories.
Click to hide internal directories.