Documentation ¶
Index ¶
- type KubernetesLeaderController
- func (lc *KubernetesLeaderController) GetLeaderReport() LeaderReport
- func (lc *KubernetesLeaderController) GetToken() LeaderToken
- func (lc *KubernetesLeaderController) RegisterListener(listener LeaseListener)
- func (lc *KubernetesLeaderController) Run(ctx *armadacontext.Context) error
- func (lc *KubernetesLeaderController) ValidateToken(tok LeaderToken) bool
- type LeaderClientConnectionProvider
- type LeaderConnectionProvider
- type LeaderController
- type LeaderReport
- type LeaderStatusMetricsCollector
- type LeaderToken
- type LeaseListener
- type StandaloneLeaderController
- func (lc *StandaloneLeaderController) GetLeaderReport() LeaderReport
- func (lc *StandaloneLeaderController) GetToken() LeaderToken
- func (lc *StandaloneLeaderController) Run(ctx *armadacontext.Context) error
- func (lc *StandaloneLeaderController) SetToken(token LeaderToken)
- func (lc *StandaloneLeaderController) ValidateToken(tok LeaderToken) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KubernetesLeaderController ¶
type KubernetesLeaderController struct {
// contains filtered or unexported fields
}
KubernetesLeaderController uses the Kubernetes leader election mechanism to determine who is leader. This allows multiple instances of the scheduler to be run for high availability.
TODO: Move into package in common.
func NewKubernetesLeaderController ¶
func NewKubernetesLeaderController(config schedulerconfig.LeaderConfig, client coordinationv1client.LeasesGetter) *KubernetesLeaderController
func (*KubernetesLeaderController) GetLeaderReport ¶
func (lc *KubernetesLeaderController) GetLeaderReport() LeaderReport
func (*KubernetesLeaderController) GetToken ¶
func (lc *KubernetesLeaderController) GetToken() LeaderToken
func (*KubernetesLeaderController) RegisterListener ¶
func (lc *KubernetesLeaderController) RegisterListener(listener LeaseListener)
func (*KubernetesLeaderController) Run ¶
func (lc *KubernetesLeaderController) Run(ctx *armadacontext.Context) error
Run starts the controller. This is a blocking call that returns when the provided context is cancelled.
func (*KubernetesLeaderController) ValidateToken ¶
func (lc *KubernetesLeaderController) ValidateToken(tok LeaderToken) bool
type LeaderClientConnectionProvider ¶
type LeaderClientConnectionProvider interface {
GetCurrentLeaderClientConnection() (bool, *grpc.ClientConn, error)
}
type LeaderConnectionProvider ¶
type LeaderConnectionProvider struct {
// contains filtered or unexported fields
}
func NewLeaderConnectionProvider ¶
func NewLeaderConnectionProvider(leaderController LeaderController, leaderConfig configuration.LeaderConfig) *LeaderConnectionProvider
func (*LeaderConnectionProvider) GetCurrentLeaderClientConnection ¶
func (l *LeaderConnectionProvider) GetCurrentLeaderClientConnection() (bool, *grpc.ClientConn, error)
type LeaderController ¶
type LeaderController interface { // GetToken returns a LeaderToken which allows you to determine if you are leader or not GetToken() LeaderToken // ValidateToken allows a caller to determine whether a previously obtained token is still valid. // Returns true if the token is a leader and false otherwise ValidateToken(tok LeaderToken) bool // Run starts the controller. This is a blocking call which will return when the provided context is cancelled Run(ctx *armadacontext.Context) error // GetLeaderReport returns a report about the current leader GetLeaderReport() LeaderReport }
LeaderController is an interface to be implemented by structs that control which scheduler is leader
type LeaderReport ¶
type LeaderStatusMetricsCollector ¶
type LeaderStatusMetricsCollector struct {
// contains filtered or unexported fields
}
func NewLeaderStatusMetricsCollector ¶
func NewLeaderStatusMetricsCollector(currentInstanceName string) *LeaderStatusMetricsCollector
func (*LeaderStatusMetricsCollector) Collect ¶
func (l *LeaderStatusMetricsCollector) Collect(metrics chan<- prometheus.Metric)
func (*LeaderStatusMetricsCollector) Describe ¶
func (l *LeaderStatusMetricsCollector) Describe(desc chan<- *prometheus.Desc)
type LeaderToken ¶
type LeaderToken struct {
// contains filtered or unexported fields
}
LeaderToken is a token handed out to schedulers which they can use to determine if they are leader
func InvalidLeaderToken ¶
func InvalidLeaderToken() LeaderToken
InvalidLeaderToken returns a LeaderToken indicating this instance is not leader.
func NewLeaderToken ¶
func NewLeaderToken() LeaderToken
NewLeaderToken returns a LeaderToken indicating this instance is the leader.
func (LeaderToken) Leader ¶
func (l LeaderToken) Leader() bool
type LeaseListener ¶
type LeaseListener interface {
// contains filtered or unexported methods
}
LeaseListener allows clients to listen for lease eventSequences.
type StandaloneLeaderController ¶
type StandaloneLeaderController struct {
// contains filtered or unexported fields
}
StandaloneLeaderController returns a token that always indicates you are leader This can be used when only a single instance of the scheduler is needed
func NewStandaloneLeaderController ¶
func NewStandaloneLeaderController() *StandaloneLeaderController
func (*StandaloneLeaderController) GetLeaderReport ¶
func (lc *StandaloneLeaderController) GetLeaderReport() LeaderReport
func (*StandaloneLeaderController) GetToken ¶
func (lc *StandaloneLeaderController) GetToken() LeaderToken
func (*StandaloneLeaderController) Run ¶
func (lc *StandaloneLeaderController) Run(ctx *armadacontext.Context) error
func (*StandaloneLeaderController) SetToken ¶
func (lc *StandaloneLeaderController) SetToken(token LeaderToken)
func (*StandaloneLeaderController) ValidateToken ¶
func (lc *StandaloneLeaderController) ValidateToken(tok LeaderToken) bool