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 yurt-coordinator is ready. // Yurt-Coordinator ready means it is ready to handle request. To be specific, it should // satisfy the following 3 condition: // 1. Yurt-Coordinator is healthy // 2. Pool-Scoped resources have been synced with cloud, through list/watch // 3. local cache has been uploaded to yurt-coordinator IsReady() (cachemanager.CacheManager, bool) // IsHealthy will return the poolCacheManager and true if the yurt-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 yurt 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.