controller-managerk8s.io/controller-manager/pkg/leadermigration Index | Files | Directories

package leadermigration

import "k8s.io/controller-manager/pkg/leadermigration"

Index

Constants

const (
	// ControllerUnowned indicates that the controller is owned by another controller manager
	//  and thus should NOT be started by this controller manager.
	ControllerUnowned = iota
	// ControllerMigrated indicates that the controller manager should start this controller
	//  with the migration lock.
	ControllerMigrated
	// ControllerNonMigrated indicates that the controller manager should start this controller
	//  with the main lock.
	ControllerNonMigrated
)

Functions

func Enabled

func Enabled(genericConfig *config.GenericControllerManagerConfiguration) bool

Enabled checks whether Leader Migration should be enabled, given the GenericControllerManagerConfiguration. It considers the feature gate first, and will always return false if the feature gate is not enabled.

Types

type FilterFunc

type FilterFunc func(controllerName string) FilterResult

FilterFunc takes a name of controller, returning a FilterResult indicating how to start controller.

type FilterResult

type FilterResult int32

FilterResult indicates whether and how the controller manager should start the controller.

type LeaderMigrator

type LeaderMigrator struct {
	// MigrationReady is closed after the controller manager finishes preparing for the migration lock.
	// After this point, the leader migration process will proceed to acquire the migration lock.
	MigrationReady chan struct{}

	// FilterFunc returns a FilterResult telling the controller manager what to do with the controller.
	FilterFunc FilterFunc
}

LeaderMigrator holds information required by the leader migration process.

func NewLeaderMigrator

func NewLeaderMigrator(config *internal.LeaderMigrationConfiguration, component string) *LeaderMigrator

NewLeaderMigrator creates a LeaderMigrator with given config for the given component. component indicates which controller manager is requesting this leader migration, and it should be consistent with the component field of ControllerLeaderConfiguration.

Source Files

filter.go migrator.go util.go

Directories

PathSynopsis
pkg/leadermigration/config
pkg/leadermigration/options
Version
v0.32.2 (latest)
Published
Feb 13, 2025
Platform
linux/amd64
Imports
1 packages
Last checked
2 months ago

Tools for package owners.