Documentation ¶
Index ¶
Constants ¶
View Source
const ( InitHub int32 = iota // 0 LeaderHub FollowerHub PendingHub )
Variables ¶
This section is empty.
Functions ¶
func NewCoordinator ¶
func NewCoordinator( ctx context.Context, cfg *config.YurtHubConfiguration, cloudHealthChecker healthchecker.MultipleBackendsHealthChecker, restMgr *yurtrest.RestConfigManager, certMgr *certmanager.CertManager, coordinatorTransMgr transport.Interface, elector *HubElector) (*coordinator, error)
Types ¶
type Coordinator ¶
type Coordinator interface { // Start the Coordinator. Run() // IsReady will return the poolCacheManager and true if the pool-coordinator is ready. // Pool-Coordinator ready means it is ready to handle request. To be specific, it should // satisfy the following 3 condition: // 1. Pool-Coordinator is healthy // 2. Pool-Scoped resources have been synced with cloud, through list/watch // 3. local cache has been uploaded to pool-coordinator IsReady() (cachemanager.CacheManager, bool) // IsCoordinatorHealthy will return the poolCacheManager and true if the pool-coordinator is healthy. // We assume coordinator is healthy when the elect status is LeaderHub and FollowerHub. IsHealthy() (cachemanager.CacheManager, bool) }
Coordinator will track the status of pool coordinator, and change the cache and proxy behaviour of yurthub accordingly.
type FakeCoordinator ¶
type FakeCoordinator struct{}
func (*FakeCoordinator) IsHealthy ¶
func (fc *FakeCoordinator) IsHealthy() (cachemanager.CacheManager, bool)
func (*FakeCoordinator) IsReady ¶
func (fc *FakeCoordinator) IsReady() (cachemanager.CacheManager, bool)
func (*FakeCoordinator) Run ¶
func (fc *FakeCoordinator) Run()
type HubElector ¶
type HubElector struct {
// contains filtered or unexported fields
}
func NewHubElector ¶
func NewHubElector( cfg *config.YurtHubConfiguration, coordinatorClient kubernetes.Interface, coordinatorHealthChecker healthchecker.HealthChecker, cloudAPIServerHealthyChecker healthchecker.MultipleBackendsHealthChecker, stopCh <-chan struct{}) (*HubElector, error)
func (*HubElector) Run ¶
func (he *HubElector) Run(stopCh <-chan struct{})
func (*HubElector) StatusChan ¶
func (he *HubElector) StatusChan() chan int32
Source Files ¶
Click to show internal directories.
Click to hide internal directories.