options

package
v4.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGOPSFlags

func AddGOPSFlags(flags *pflag.FlagSet)

AddGOPSFlags to NewControllerManagerCommand

func AddKlogFlags

func AddKlogFlags(fs *pflag.FlagSet)

AddKlogFlags to NewControllerManagerCommand

func AddProfilingFlags

func AddProfilingFlags(flags *pflag.FlagSet)

AddProfilingFlags to NewControllerManagerCommand

func FlushProfiling

func FlushProfiling() error

FlushProfiling to local file

func InitGOPS

func InitGOPS() error

InitGOPS if gops is true

func InitProfiling

func InitProfiling(ctx context.Context) error

InitProfiling for profileName

func Register

func Register(reconciler Controller) error

Register controller

Types

type Controller

type Controller interface {
	// setup reconcile with manager
	SetupWithManager(mgr ctrl.Manager, o ControllerManagerServerOptions) error
	// the Name of controller
	Name() string
}

Controller should add in ctrl.manager

type ControllerManagerServerOptions

type ControllerManagerServerOptions struct {
	// Debug mode, after a successful execution of Playbook, will retain runtime data, which includes task execution status and parameters.
	Debug bool

	MaxConcurrentReconciles int
	LeaderElection          bool
	LeaderElectionID        string
	// LeaderElectionResourceLock determines which resource lock to use for leader election,
	// defaults to "leases". Change this value only if you know what you are doing.
	//
	// If you are using `configmaps`/`endpoints` resource lock and want to migrate to "leases",
	// you might do so by migrating to the respective multilock first ("configmapsleases" or "endpointsleases"),
	// which will acquire a leader lock on both resources.
	// After all your users have migrated to the multilock, you can go ahead and migrate to "leases".
	// Please also keep in mind, that users might skip versions of your controller.
	//
	// Note: before controller-runtime version v0.7, it was set to "configmaps".
	// And from v0.7 to v0.11, the default was "configmapsleases", which was
	// used to migrate from configmaps to leases.
	// Since the default was "configmapsleases" for over a year, spanning five minor releases,
	// any actively maintained operators are very likely to have a released version that uses
	// "configmapsleases". Therefore defaulting to "leases" should be safe since v0.12.
	//
	// So, what do you have to do when you are updating your controller-runtime dependency
	// from a lower version to v0.12 or newer?
	// - If your operator matches at least one of these conditions:
	//   - the LeaderElectionResourceLock in your operator has already been explicitly set to "leases"
	//   - the old controller-runtime version is between v0.7.0 and v0.11.x and the
	//     LeaderElectionResourceLock wasn't set or was set to "leases"/"configmapsleases"/"endpointsleases"
	//   feel free to update controller-runtime to v0.12 or newer.
	// - Otherwise, you may have to take these steps:
	//   1. update controller-runtime to v0.12 or newer in your go.mod
	//   2. set LeaderElectionResourceLock to "configmapsleases" (or "endpointsleases")
	//   3. package your operator and upgrade it in all your clusters
	//   4. only if you have finished 3, you can remove the LeaderElectionResourceLock to use the default "leases"
	// Otherwise, your operator might end up with multiple running instances that
	// each acquired leadership through different resource locks during upgrades and thus
	// act on the same resources concurrently.
	LeaderElectionResourceLock string
	// ControllerGates is the list of controller gates to enable or disable controller.
	// '*' means "all enabled by default controllers"
	// 'foo' means "enable 'foo'"
	// '-foo' means "disable 'foo'"
	// first item for a particular name wins.
	//     e.g. '-foo,foo' means "disable foo", 'foo,-foo' means "enable foo"
	// * has the lowest priority.
	//     e.g. *,-foo, means "disable 'foo'"
	ControllerGates []string
	Controllers     []Controller
}

ControllerManagerServerOptions for NewControllerManagerServerOptions

func NewControllerManagerServerOptions

func NewControllerManagerServerOptions() *ControllerManagerServerOptions

NewControllerManagerServerOptions for NewControllerManagerCommand

func (*ControllerManagerServerOptions) Complete

func (o *ControllerManagerServerOptions) Complete()

Complete for ControllerManagerServerOptions

func (*ControllerManagerServerOptions) Flags

Flags add to NewControllerManagerCommand

Jump to

Keyboard shortcuts

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