manager

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GatewayClassControllerName is the name of the GatewayClass controller.
	GatewayClassControllerName = "GatewayClass"
	// GatewayControllerName is the name of the GatewayClass controller.
	GatewayControllerName = "Gateway"
	// ControlPlaneControllerName is the name of the GatewayClass controller.
	ControlPlaneControllerName = "ControlPlane"
	// DataPlaneControllerName is the name of the GatewayClass controller.
	DataPlaneControllerName = "DataPlane"
	// DataPlaneBlueGreenControllerName is the name of the GatewayClass controller.
	DataPlaneBlueGreenControllerName = "DataPlaneBlueGreen"
	// DataPlaneOwnedServiceFinalizerControllerName is the name of the GatewayClass controller.
	DataPlaneOwnedServiceFinalizerControllerName = "DataPlaneOwnedServiceFinalizer"
	// DataPlaneOwnedSecretFinalizerControllerName is the name of the GatewayClass controller.
	DataPlaneOwnedSecretFinalizerControllerName = "DataPlaneOwnedSecretFinalizer"
	// DataPlaneOwnedDeploymentFinalizerControllerName is the name of the GatewayClass controller.
	DataPlaneOwnedDeploymentFinalizerControllerName = "DataPlaneOwnedDeploymentFinalizer"
	// AIGatewayControllerName is the name of the GatewayClass controller.
	AIGatewayControllerName = "AIGateway"
)

Variables

This section is empty.

Functions

func Run

func Run(
	cfg Config,
	scheme *runtime.Scheme,
	setupControllers SetupControllersFunc,
	admissionRequestHandler AdmissionRequestHandlerFunc,
	startedChan chan<- struct{},
) error

Run runs the manager. Parameter cfg represents the configuration for the manager that for normal operation is derived from command-line flags. The function setupControllers is expected to return a list of configured ControllerDef that will be added to the manager. The function admissionRequestHandler is used to construct the admission webhook handler for the validating webhook that is added to the manager too. Argument startedChan can be used as a signal to notify the caller when the manager has been started. Specifically, this channel gets closed when manager.Start() is called. Pass nil if you don't need this signal.

func SetupControllers

func SetupControllers(mgr manager.Manager, c *Config) (map[string]ControllerDef, error)

SetupControllers returns a list of ControllerDefs based on config.

Types

type AdmissionRequestHandlerFunc

type AdmissionRequestHandlerFunc func(c client.Client, l logr.Logger) *admission.RequestHandler

AdmissionRequestHandlerFunc is a function that returns an implementation of admission.RequestHandler, (validation webhook) it's passed to Run function and called later.

type AutoHandler

type AutoHandler func(client.Client) (bool, error)

AutoHandler decides whether the specific controller shall be enabled (true) or disabled (false).

type Config

type Config struct {
	MetricsAddr              string
	ProbeAddr                string
	WebhookCertDir           string
	WebhookPort              int
	LeaderElection           bool
	LeaderElectionNamespace  string
	DevelopmentMode          bool
	Out                      *os.File
	NewClientFunc            client.NewClientFunc
	ControllerName           string
	ControllerNamespace      string
	AnonymousReports         bool
	APIServerPath            string
	KubeconfigPath           string
	ClusterCASecretName      string
	ClusterCASecretNamespace string
	LoggerOpts               *zap.Options

	// controllers for standard APIs and features
	GatewayControllerEnabled            bool
	ControlPlaneControllerEnabled       bool
	DataPlaneControllerEnabled          bool
	DataPlaneBlueGreenControllerEnabled bool

	// Controllers for speciality APIs and experimental features.
	AIGatewayControllerEnabled bool

	// webhook and validation options
	ValidatingWebhookEnabled bool
}

Config represents the configuration for the manager.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a default configuration for the manager.

type Controller

type Controller interface {
	SetupWithManager(ctrl.Manager) error
}

Controller is a Kubernetes controller that can be plugged into Manager.

type ControllerDef

type ControllerDef struct {
	Enabled    bool
	Controller Controller
}

ControllerDef is a specification of a Controller that can be conditionally registered with Manager.

func SetupControllersShim

func SetupControllersShim(mgr manager.Manager, c *Config) ([]ControllerDef, error)

SetupControllersShim runs SetupControllers and returns its result as a slice of the map values.

func (*ControllerDef) MaybeSetupWithManager

func (c *ControllerDef) MaybeSetupWithManager(mgr ctrl.Manager) error

MaybeSetupWithManager runs SetupWithManager on the controller if it is enabled and its AutoHandler (if any) indicates that it can load.

func (*ControllerDef) Name

func (c *ControllerDef) Name() string

Name returns a human-readable name of the controller.

type SetupControllersFunc

type SetupControllersFunc func(manager.Manager, *Config) ([]ControllerDef, error)

SetupControllersFunc represents function to setup controllers, which is called in Run function.

Directories

Path Synopsis
Package metadata includes metadata variables for logging and reporting.
Package metadata includes metadata variables for logging and reporting.

Jump to

Keyboard shortcuts

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