bootstrap

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ctx context.Context, rootLogger string, start StartReconciler, opts Options, localMode bool) error

Start a controller with the given reconciler. Handles bootstrapping local manager + multicluster watches. localMode will start the controller as an "local" only configured to do i/o to local cluster.

Types

type Options

type Options struct {
	// MetricsBindPort is the TCP port that the controller should bind to
	// for serving prometheus metrics.
	// It can be set to 0 to disable the metrics serving.
	MetricsBindPort uint32

	// MasterNamespace if specified restricts the Master manager's cache to watch objects in the desired namespace.
	// Defaults to all namespaces.
	//
	// Note: If a namespace is specified, controllers can still Watch for a cluster-scoped resource (e.g Node).  For namespaced resources the cache will only hold objects from the desired namespace.
	MasterNamespace string

	// enables verbose mode
	VerboseMode bool

	// ManagementContext if specified read the KubeConfig for the management cluster from this context. Only applies when running out of cluster.
	ManagementContext string

	// Reference to the Settings object that the controller should use.
	SettingsRef v1.ObjectRef
}

bootstrap options for starting discovery

func (*Options) AddToFlags

func (opts *Options) AddToFlags(flags *pflag.FlagSet)

convenience function for setting these options via spf13 flags

type StartParameters

type StartParameters struct {
	Ctx             context.Context
	MasterManager   manager.Manager
	McClient        multicluster.Client    // nil if running in agent mode
	Clusters        multicluster.Interface // nil if running in agent mode
	SnapshotHistory *stats.SnapshotHistory
	// Reference to Settings object this controller uses.
	SettingsRef v1.ObjectRef
	// enable additional logging
	VerboseMode bool
}

type StartReconciler

type StartReconciler func(
	parameters StartParameters,
) error

Jump to

Keyboard shortcuts

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