Documentation ¶
Index ¶
- Constants
- func Run(cfg Config, scheme *runtime.Scheme, setupControllers SetupControllersFunc, ...) error
- func SetupControllers(mgr manager.Manager, c *Config) (map[string]ControllerDef, error)
- type AdmissionRequestHandlerFunc
- type AutoHandler
- type Config
- type Controller
- type ControllerDef
- type SetupControllersFunc
Constants ¶
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 ¶
SetupControllers returns a list of ControllerDefs based on config.
Types ¶
type AdmissionRequestHandlerFunc ¶
AdmissionRequestHandlerFunc is a function that returns an implementation of admission.RequestHandler, (validation webhook) it's passed to Run function and called later.
type AutoHandler ¶
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 ¶
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.