yurtcoordinator

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

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)

func NewInformerLease

func NewInformerLease(coordinatorClient clientset.Interface, leaseName string, leaseNamespace string, holderIdentity string, leaseDurationSeconds int32, failedRetry int) informerLease

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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